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
{{ message }}
Repository navigation
Add meta-estimator for switching between estimators #2994
Using Pipeline and FeatureUnion one can combine multiple estimators into a single object and do a joint parameter selection. But they didn't help with a joint model selection if you want to use a different estimator class at some step (e.g. select a different classifier) or disable some step entirely (e.g. exclude some features).
What do you think about adding "Alternatives" or "Switch" or "EstimatorSelector" or "Selector" meta-estimator that will allow choose between estimators using its set_params?
fu = FeatureUnion([
('pca', Selector([
('linear', PCA()),
('kernel', KernelPCA()),
('disabled', None), # or something like ('disabled', NoFeatures()),
], estimator='linear')),
('truncated_svd', TruncatedSVD()),
])
Then you can use fu.set_params(pca__estimator='kernel', pca__kernel__n_components=10) or fu.set_params(pca__estimator='disabled'). We may also support fu.set_params(pca__estimator=None) directly without a need to define 'disabled' option.
Activity
kmike commentedon Mar 24, 2014
Just found #1769 which provides a more intrusive but more user-friendly alternative for that.