8000 linear_model.LinearRegression attr. coef_ wrong shape · Issue #378 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

linear_model.LinearRegression attr. coef_ wrong shape #378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
akeshavan opened this issue Oct 3, 2011 · 1 comment
Closed

linear_model.LinearRegression attr. coef_ wrong shape #378

akeshavan opened this issue Oct 3, 2011 · 1 comment

Comments

@akeshavan
Copy link
Contributor

Hi,

I tried to use sklearn.feature_selection.rfe.RFECV with linear_model.LinearRegression as an estimator and it doesn't work because the shape of the coef_ attribute is 1D (n,) when it should be (1,n).

From the documentation for RFECV, it says "The first dimension of the coef_ array must be equal to the number of features of the input dataset of the estimator."

When I use svm.SVR as the estimator, RFECV works, and coef_.shape = (1,n) so I think the shape of linear_model.LinearRegression.coef_ just needs to be changed

glouppe added a commit that referenced this issue Oct 3, 2011
@glouppe
Copy link
Contributor
glouppe commented Oct 3, 2011

Thank you for the report! I have fixed the RFE module so that both (n,) and (1,n) are now supported.

@glouppe glouppe closed this as completed Oct 3, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0