You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when using SequentialFeatureSelector, it internally performs cross-validation to decide which features to select, based on the scoring function. However, the final cross-validation score (e.g., recall) is not returned by the SFS object.
Describe your proposed solution
Add an attribute (e.g., final_cv_score_) that stores the mean cross-validation score of the final model with the selected features. This would avoid having to run another cross-validation externally to get the final performance score.
Describe alternatives you've considered, if relevant
No response
Additional context
This feature would be especially useful when the scoring metric is expensive to compute, as it would avoid redundant cross-validation runs.
The text was updated successfully, but these errors were encountered:
Hey i gotch you, You need to calculate the final_cv_score_ in the SequentialFeatureSelector, so do you want the cv score for each epoch of the model or you need an entire cv score
Case 1) If you want and final_cv_score__ for each epoch you need to modify the scklearn code and add the accuracy field in it.
Case 2) If you want overall fianl_cv_score_ for entire model then use the accuracy_Score form the sklearn.metrics
You can get the predicted metrics from the method get_support the you can calulate the fianl_cv_score_
If you want modified SequentialFeatureSelector code with the field final_cv_score_ please check my github.
I think this sounds like a reasonable feature to add.
I tried to look around existing estimators to see what name is used for the fitted parameter. In TunedThresholdClassifier and GridSearchCV it is called best_score_. On the one hand it would be nice to have something consistent, on the other hand maybe here it isn't really a "best score"? Maybe something to address in a discussion in a PR.
Describe the workflow you want to enable
Currently, when using
SequentialFeatureSelector
, it internally performs cross-validation to decide which features to select, based on the scoring function. However, the final cross-validation score (e.g., recall) is not returned by the SFS object.Describe your proposed solution
Add an attribute (e.g.,
final_cv_score_
) that stores the mean cross-validation score of the final model with the selected features. This would avoid having to run another cross-validation externally to get the final performance score.Describe alternatives you've considered, if relevant
No response
Additional context
This feature would be especially useful when the scoring metric is expensive to compute, as it would avoid redundant cross-validation runs.
The text was updated successfully, but these errors were encountered: