1
$\begingroup$

I used the following methods:

Variance_Threshold: selecto_vth = VarianceThreshold(threshold=1.0)

ANOVA: anova = SelectKBest(score_func=f_classif, k=20)

Mutual_Information: fs_mutual = SelectKBest(score_func=mutual_info_classif, k=20)

Sequential_Feature_Selector: sfs = SequentialFeatureSelector(RandomForestClassifier(), n_features_to_select=20, scoring='accuracy')

But I did not find how to get the their Accuracy, unlike Recursive Feature Elimination:

print(accuracy_score(y_test, rfe.predict(x_test))) # it worked
$\endgroup$
2
  • 1
    $\begingroup$ one way is to create a model with the (best) selected features and measure the accuracy of the model $\endgroup$ – Nikos M. Jun 23 at 14:39
  • $\begingroup$ Dear @NikosM. Thank you :) $\endgroup$ – Mimi Jun 23 at 15:01
2
$\begingroup$

One way (I know no other way, btw) is to create a model with the (best) selected features and measure the accuracy of that model.

This accuracy will be parametrised by the model you used. For example, using a different model might alter the accuracy, so using a handful of models and getting the average will give you a hint of the accuracy of the features selected.

This procedure is exactly similar to the procedure followed by sklearn.feature_selection.RFE where a model (an estimator) is passed as parameter.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.