scikit-learn/scikit-learn — Issue #470: LogisticRegression and LinearSVC should have read-write coef_ and intercept_ attributes
Author: ogrisel
Created: 2011-12-18 11:00:31+00:00
State: open

As reported on this [stackoverflow question](http://stackoverflow.com/questions/8539141/sklearn-scikit-learn-logistic-regression-package-set-trained-coefficients-f/8551193#8551193) the current implementation of liblinear models is using a special memory layout for the coefficient (currently stored in the `raw_coef_` array). Those coefficients are made read-only accessible to the user by means of the python properties `coef_` and `intercept_`. However this solution prevents the user to change some of the coefficient values or to reassign a complete `coef_` array on a the fitted parameter.

It would be much nicer to have `coef_` / `intercept_` as traditional array attributes instead.

Options:
- store copy the fit of liblinear parameters using the traditional `coef_` / `intercept_` layout and copy those parameters at prediction time to a temporary array suitable for prediction using liblinear
- implement `predict` and `predict_proba` in numpy instead of using `liblinear` at prediction time hence we could use standard numpy arrays with the usual layout for `coef_` and `intercept_`