Skip to content
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

SoftmaxRegression is not cloneable #372

Closed
vanoudh opened this issue Apr 24, 2018 · 6 comments
Closed

SoftmaxRegression is not cloneable #372

vanoudh opened this issue Apr 24, 2018 · 6 comments

Comments

@vanoudh
Copy link

vanoudh commented Apr 24, 2018

from sklearn.base import clone
from mlxtend.classifier import SoftmaxRegression

clf = SoftmaxRegression()
clfc = clone(clf)

-> "it does not seem to be a scikit-learn estimator as it does not implement a 'get_params' methods."

It seems that just deriving from BaseEstimator solves the issue but I am not sure.

@jrbourbeau
Copy link
Contributor

@vanoudh I was able to reproduce this error with the current master branch. I checked and you're correct, having SoftmaxRegression inherit from BaseEstimator does fix the cloning problem. Are you interested in opening a PR?

@jrbourbeau
Copy link
Contributor

So it's documented somewhere, it looks like there are a few other estimators that also don't inherit from BaseEstimator:

Classifiers:

  • SoftmaxRegression
  • LogisticRegression
  • Adaline
  • MultiLayerPerceptron
  • Perceptron

Regressors:

  • LinearRegression

@rasbt
Copy link
Owner

rasbt commented Apr 24, 2018

Thanks for the head-up, will fix that!

@vanoudh
Copy link
Author

vanoudh commented Apr 24, 2018

Thanks a lot.

@rasbt
Copy link
Owner

rasbt commented Apr 25, 2018

So it's documented somewhere, it looks like there are a few other estimators that also don't inherit from BaseEstimator:

Thanks for the list, @jrbourbeau . I updated the existing _BaseEstimator with the necessary functions to make them all compatible

@rasbt
Copy link
Owner

rasbt commented Apr 25, 2018

Should be fixed now :)

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

3 participants