Skip to content

RFC Renames reset to in_fit in _validate_data #18001

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
wants to merge 1 commit into from

Conversation

thomasjpfan
Copy link
Member

I think in_fit or fitting has clearer semantics than reset when thinking of _validate_data.

The small code change is to check y only when fitting:

if in_fit and self._get_tags()['requires_y']:

CC @NicolasHug

@NicolasHug
Copy link
Member

I think the name was discussed quite a bit in the SLEP PR and in the implementation PR.

We need to reset the n_features_in attribute when:

  • fit is called
  • partial_fit is called for the first time only

in_fit and fitting don't reflect this semantic, I think.

@thomasjpfan
Copy link
Member Author

For the partial fit it makes sense. The semantics of calling _validate_data in predict is strange to me:

if reset and self._get_tags()['requires_y']:

Closing. I can not think of a nicer way handle this.

@NicolasHug
Copy link
Member

The semantics of calling _validate_data in predict is strange to me

I agree. Maybe we should consider having a second method to use in predict, transform, etc?

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