![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
机器学习
he626shidizai
这个作者很懒,什么都没留下…
展开
-
使用结巴分词时出现 'float' object has no attribute 'decode'
问题:word_neu = []for c in comment_neu: #comment是一个pandas中的series word_neu.append(sent2word(c))运行代码出现问题:‘float’ object has no attribute ‘decode’很纳闷?怎么会出现float类型呢然后百度找到一篇博客jieba分词出现如下错误:Attribu...原创 2019-01-11 22:32:04 · 2127 阅读 · 0 评论 -
Numpy:only integer scalar arrays can be converted to a scalar index
import numpy as npY = np.concatenate(np.ones(10), np.zeros(10))今天运行这段代码的时候,报错:only integer scalar arrays can be converted to a scalar index在网络上搜索之后发现,concatenate函数的原型为concatenate((a1, a2, …), axi...原创 2019-01-15 16:59:02 · 2804 阅读 · 1 评论 -
SVM TypeError: must be real number, not str
早上看sklearn的官网的svm部分,把代码复制粘贴到jupyter notebook中,但是执行代码clf = SVC(gamma='scale')clf.fit(X, y)#在这里报错却报错:TypeError: must be real number, not str在网上找了半天没找到解决方法,我的sklearn版本为0.19.1 猜测是版本问题然后我把参数改了之后就不会报错...原创 2019-01-21 14:47:02 · 6919 阅读 · 14 评论