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

Add y argument to fit method, for sklearn compatibility #17

Merged
merged 1 commit into from
Oct 10, 2018
Merged

Add y argument to fit method, for sklearn compatibility #17

merged 1 commit into from
Oct 10, 2018

Conversation

adodge
Copy link

@adodge adodge commented Oct 9, 2018

The fit() method in sklearn has the signature fit(X,y) even if the class doesn't use the y value. This allows the object to be used in Pipelines, etc.

For example, note the fit() method for CountVectorizer: https://github.com/scikit-learn/scikit-learn/blob/bac89c2/sklearn/feature_extraction/text.py#L966

@gregversteeg gregversteeg merged commit e1ad66d into gregversteeg:master Oct 10, 2018
@gregversteeg
Copy link
Owner

Thanks adodge, that's very useful!

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

Successfully merging this pull request may close these issues.

2 participants