false true false true false false false false false false true false true false false false false true false true false false false false true true false true false false false falsefigure - features selected by selectpercentile as you can see from the visualization of the maskmost of the selected features are the original featuresand most of the noise features were removed howeverthe recovery of the original features is not perfect let' compare the performance of logistic regression on all features against the performance using only the selected featuresin[ ]from sklearn linear_model import logisticregression transform test data x_test_selected select transform(x_testlr logisticregression(lr fit(x_trainy_trainprint("score with all features{ }format(lr score(x_testy_test))lr fit(x_train_selectedy_trainprint("score with only selected features{ }formatlr score(x_test_selectedy_test))out[ ]score with all features score with only selected features in this caseremoving the noise features improved performanceeven though some of the original features were lost this was very simple synthetic exampleand outcomes on real data are usually mixed univariate feature selection can still be very helpfulthoughif there is such large number of features that building model on them is infeasibleor if you suspect that many features are completely uninformative model-based feature selection model-based feature selection uses supervised machine learning model to judge the importance of each featureand keeps only the most important ones the supervised model that is used for feature selection doesn' need to be the same model that is used for the final supervised modeling the feature selection model needs to provide some measure of importance for each featureso that they can be ranked by this measure decision trees and decision tree-based models provide feature_importances_ representing data and engineering features