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
Allow for passing additional parameters to the estimator's fit
method in SequentialFeatureSelector
#25236
Comments
We are most certainly interested to be able to pass additional parameters. The SLEP006 is intending to do so. @adrinjalali do you think that we should be implemented this support now or we should await the implementation of the SLEP006 to land in |
I had a look at SLEP006 and I believe its implementation is required, since passing |
Since there's only one sub-estimator here, and no routing like in the pipeline is required, we can go ahead and have a PR for this independent of SLEP006, It'd be required anyway. |
@adrinjalali Thanks for looking into this! Is there already a way to pass If there's already a way to accomplish this, I'm happy to give adding a |
No we can't support |
Just to be sure that I understand correctly: If that's the case, I don't think there's much use for a |
Yes.
In that case, we can fix this after SLEP006 is implemented. |
Describe the workflow you want to enable
I would like to be able to pass sample weights to the
fit
method of the estimator inSequentialFeatureSelector
. (SelectFromModel
has this feature as well.)Looking at the code, it seems to me that
sklearn.model_selection._validation._fit_and_score
, which is where the actual scoring takes place, already supports sample weights in cross-validation (i.e., takes care of passing only the weights for samples that are actually part of the fold).Describe your proposed solution
Based on my current understanding,
SequentialFeatureSelector.fit()
would need to get an additional argumentfit_params
(cf.SelectFromModel.fit()
) that is passed on to thecross_val_score
function called inSequentialFeatureSelector._get_best_new_feature_score
. Everything else appears to be in place already.if that's all it takes, I'm happy to prepare a PR. But I might very well be overlooking issues or unintended consequences.
Describe alternatives you've considered, if relevant
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: