1
$\begingroup$

I am new to machine learning. I would like to know how correctly interpret Scikit_learn's f_regression values, in order to perform a good feature selection (I'm using f_regression as score function of SelectKBest()). More precisely: is a feature with a high value always better than one with a lower value? How have I to interpret f-regression's values when I am using categorical variables?

$\endgroup$
0
$\begingroup$

Pick the variables with the highest F-statistic. If you want, you can use a more handy function, like "feature_selection.SelectPercentile".

selector = feature_selection.SelectPercentile(feature_selection.f_regression, percentile=30)
selector.fit(X_train, y_train)
selector.get_support(True)

The method get_support (with True) will return the indexes of the selected features, according to the percentile.

$\endgroup$
1

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.