m_a*_*ber 3 python machine-learning svm scikit-learn
我对scikit和ML有点新鲜感.我试图训练一个SVM分类器用于一个与所有分类.我使用以下代码.
g=list()
for i in range(0,120):
g.append(1)
for i in range(120,240):
g.append(2)
u=set(g)
numclasses=len(u)
lin_clf = svm.LinearSVC()
lin_clf.fit(features,u)
Run Code Online (Sandbox Code Playgroud)
功能是72900*120阵列.我从不同的python代码获取功能并在此处调用它.它会抛出以下警告和错误.
/usr/lib/python2.7/dist-packages/scipy/misc/pilutil.py:279:
DeprecationWarning: fromstring() is deprecated. Please call frombytes() instead.
image = Image.fromstring(mode, shape, strdata)
Run Code Online (Sandbox Code Playgroud)
错误
ValueError: bad input shape ()
Run Code Online (Sandbox Code Playgroud)
如果您需要特征提取代码,请发表评论.先感谢您.
归档时间: |
|
查看次数: |
13180 次 |
最近记录: |