machine learning - Logistic Regression Scikit-Learn Getting the coefficients of the classification -
i doing multiclass classification , applying logistic regression on it
when fitted data calling
logistic.fit(inputdata,outputdata)
the estimator "logistic " fits data.
now when call logistic.coef_
prints 2d array 4 rows(i had 4 classes) , n columns(one each feature)
this saw on scikit learn site:
coef_ : array, shape (n_features, ) or (n_targets, n_features) estimated coefficients linear regression problem. if multiple targets passed during fit (y 2d), 2d array of shape (n_targets, n_features), while if 1 target passed, 1d array of length n_features.
now query : why different coefficients there different classes need 1 hypothesis predict output.
as have multiclass case (>2 cases) one-vs-rest strategy applied. sklearn creates 4 classiefiers, not 1. hence have 4 hypothesis , 4*coefficents.
note: have no clue logistic regression classifier, how sklearn svm work.
Comments
Post a Comment