我正在使用 SVM 分类器进行多类分类。
我希望 svc.predict 返回结果以及其他类的概率。
我得到的结果是这样的:
print(svclassifier.predict([[79,93,60,50,50,80,81,88,87,100,100,71,100,83,100,100,75,70,100,60]]))
预期输出是类别编号= 27
获得的输出是:27
但我想要概率形式的输出......
最佳答案
是的,您可以使用 predict_proba
方法(请参阅 documentation )。
另请考虑文档中的注释:
The probability model is created using cross validation, so the results can be slightly different than those obtained by predict. Also, it will produce meaningless results on very small datasets
关于python - svc.predict 可以返回结果以及其他类的概率吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59467437/