Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(Voting): Allow a prefit option to VotingClassifier/Regressor #28434

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

eddiebergman
Copy link
Contributor

@eddiebergman eddiebergman commented Feb 16, 2024

Reference Issues/PRs

What does this implement/fix? Explain your changes.

This feature enables the user to pass in prefit estimators to both VotingClassifier and VotingRegressor by specifying prefit=True.

The VotingX is still required to have fit() called on it to do validation of the prefit estimators but it does not perform model fitting during this period.

Along with this, I've provided some basic first testing to ensure that the prefit estimators work equally if fit outside vs inside the Voter and validation checks during the call to VotingX.fit() to ensure that that prefit estimators are aligned in terms of the data that can flow through them.

Any other comments?

This is mainly a draft PR to backup my comment left on issue #12297 with an initial implementation. There are likely a lot of missing features and issues that could arise.

Below is a list of issues that need to be resolved for this feature to integrate properly or issues that need to be discussed.

Issues

  • When calling VotingX(estimators, prefit=True).fit(X, y), should the Voter validate that the estimators are aligned with eachother, or with the passed in X, y, in terms of attributes like n_features_in_ and n_feature_names_?
  • What should be the defined clone behavior of this estimator, in relation to this comment by @amueller, linking to API Freezing estimators #8370
  • What tags should be attached to the prefit version of a Voter with respect to the suite of estimator tests that exist for scikit-learn integrations.

As a meta-level question, should there exist a separate PrefitVotingX to alleviate some of this issues and simplify internals, at the expense of introducing a new estimator class?


TODOs if accepted

  • Add a ..versionadded:: to the docstrings
  • Add a changelog entry

@eddiebergman eddiebergman marked this pull request as draft February 16, 2024 10:21
Copy link

github-actions bot commented Feb 16, 2024

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: e734f40. Link to the linter CI: here

Added a note in the draft PR to add this back in
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

prefit option missing for voting?
1 participant