Есть ли способ получить коэффициенты SequentialFeatureSelection после подгонки модели? ⇐ Python
-
Гость
Есть ли способ получить коэффициенты SequentialFeatureSelection после подгонки модели?
I'm trying to work on feature selection to identify the features that are related to the response. So far I've used RFE, RFECV, SelectFromModel and SequentialFeatureSelection from sklearn. After model fit, the selector's estimator attributes allow me to obtain resulting coefficients for all models except SequentialFeatureSelection. Is there a solution for this?
I've tried comparing it to other models, but seems like the selector's estimator attributes are not applicable for SequentialFeatureSelection. The score attribute doesn't help either. Is there maybe another way?
RFE:
estimator = LinearRegression() selector = RFE(estimator, n_features_to_select=3, step=1) selector = selector.fit(df[features], df.Y) coef = selector.estimator_.coef_ SFS:
sfs = SequentialFeatureSelector(estimator, n_features_to_select=3, scoring=(make_scorer(R_squared))) selector = sfs.fit(df[features], df.Y) coef = ?
Источник: https://stackoverflow.com/questions/780 ... after-mode
I'm trying to work on feature selection to identify the features that are related to the response. So far I've used RFE, RFECV, SelectFromModel and SequentialFeatureSelection from sklearn. After model fit, the selector's estimator attributes allow me to obtain resulting coefficients for all models except SequentialFeatureSelection. Is there a solution for this?
I've tried comparing it to other models, but seems like the selector's estimator attributes are not applicable for SequentialFeatureSelection. The score attribute doesn't help either. Is there maybe another way?
RFE:
estimator = LinearRegression() selector = RFE(estimator, n_features_to_select=3, step=1) selector = selector.fit(df[features], df.Y) coef = selector.estimator_.coef_ SFS:
sfs = SequentialFeatureSelector(estimator, n_features_to_select=3, scoring=(make_scorer(R_squared))) selector = sfs.fit(df[features], df.Y) coef = ?
Источник: https://stackoverflow.com/questions/780 ... after-mode