分类模型输出y值

y=w0+w1x1+w2x2+....+wnxn

coef_:存储w1,w2,...wn.

intercept_:存储w0

dual_coef_*support_vectors_=coef_

(1)SVM

只有核函数为linear时,才可以用coef_,intercept_

其他核函数clf.decision_function(text)可直接输出

(2)Bayes

可以用coef_,intercept_

(3)LogisticRegression

可以用coef_,intercept_

(4)GDBT

clf.decision_function(text)可直接输出

(5)RandomForest

原文地址:https://www.cnblogs.com/wangleBlogs/p/6909549.html