我一直在尝试使用 SimpleCV 进行简单的二进制分类SVMClassifier
。这是我尝试过的,然后是错误:
svm = SVMClassifier([HueHistogramFeatureExtractor])
svm.train([train_airplanes, train_leaves], ['Airplanes', 'Leaves'])
错误:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-31-50d09bd20b62> in <module>()
1 svm = SVMClassifier([HueHistogramFeatureExtractor])
----> 2 svm.train([train_airplanes, train_leaves], ['Airplanes', 'Leaves'])
/usr/local/lib/python2.7/dist-packages/SimpleCV/MachineLearning/SVMClassifier.pyc in train(self, paths, classNames, disp, subset, savedata, verbose)
229 colNames = []
230 for extractor in self.mFeatureExtractors:
--> 231 colNames.extend(extractor.getFieldNames())
232
233 if(count <= 0):
TypeError: unbound method getFieldNames() must be called with HueHistogramFeatureExtractor instance as first argument (got nothing instead)
文档非常稀少,所以我不确定我应该做些什么不同的事情。