Jieyun Fu
2011-12-16 19:28:28 UTC
So I read the scikit-learn package webpate:
http://scikit-learn.sourceforge.net/dev/modules/generated/sklearn.linear_model.LogisticRegression.html
I can use logistic regression to fit the data, and after I obtain an
instance of LogisticRegression, I can use it to classify new data points.
So far so good.
Is there a way to set the coefficients of LogisticRegression() instance
though? Because after I obtain the trained coefficients, I want to use the
same API to classify new data points. I also don't want to keep retraining
the data to obtain that particular instance that has the coefficients I
want.
For example, I want to do something like
lg = LogisticRegression()
lg.coef_ = [blah blah blah]
http://scikit-learn.sourceforge.net/dev/modules/generated/sklearn.linear_model.LogisticRegression.html
I can use logistic regression to fit the data, and after I obtain an
instance of LogisticRegression, I can use it to classify new data points.
So far so good.
Is there a way to set the coefficients of LogisticRegression() instance
though? Because after I obtain the trained coefficients, I want to use the
same API to classify new data points. I also don't want to keep retraining
the data to obtain that particular instance that has the coefficients I
want.
For example, I want to do something like
lg = LogisticRegression()
lg.coef_ = [blah blah blah]