Skip to content

LogisticRegression and LinearSVC should have read-write coef_ and intercept_ attributes #470

@ogrisel

Description

@ogrisel

As reported on this stackoverflow question 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 estimator.

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

Options:

  • store parameters fitted by liblinear 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_

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions