15

我从 Scikit-learn 开始...

>>> import sklearn
>>> sklearn.__version__
'0.13.1'
>>> from sklearn import svm
>>> model = svm.SVC(probability=True)
>>> X = [[1,2,3], [2,3,4]] # feature vectors
>>> Y = ['apple', 'orange'] # classes
>>> model.fit(X, Y)
>>> model.predict_proba([1,2,3])
array([[ 0.39097541,  0.60902459]])

我怎么知道哪个班级应该是哪个班级?

4

1 回答 1

16

预测结果按以下顺序属于类别:model.classes_

于 2013-06-06T14:20:49.460 回答