Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sklearn univariate feature selection

I am trying to use sklearn univariate feature selection to filter out irrelevant features:

ufs = feature_selection.SelectPercentile(feature_selection.f_classif, percentile = 60)
X_default_cvtrain = ufs.fit_transform( X_cvtrain, Y_cvtrain )

However, I get this warning:

UserWarning: Duplicate scores. Result may depend on feature ordering.
             There are probably duplicate features, or you used a classification score for a regression task.
warn("Duplicate scores. Result may depend on feature ordering."

What does it mean? What is going on here?

Thanks.

like image 408
Munichong Avatar asked May 13 '26 05:05

Munichong


1 Answers

It means that there are duplicate scores, so the selected features depend on the feature ordering. A probable cause is that you have duplicate features.

like image 111
Andreas Mueller Avatar answered May 15 '26 20:05

Andreas Mueller



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!