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.
    Commented Jun 23, 2021 at 14:39
  • $\begingroup$ Dear @NikosM. Thank you :) $\endgroup$
    – Mimi
    Commented Jun 23, 2021 at 15:01

1 Answer 1

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 and acknowledge you have read our privacy policy.

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