figure - selected feature subset of the wisconsin diagnostic breast cancer dataset using chi-square tests the dataframe with the top scoring features is depicted in figure - let' now build simple classification model using logistic regression on the original feature set of features and compare the model accuracy performance with another model built using our selected features for model evaluationwe will use the accuracy metric (percent of correct predictionsand use five-fold cross-validation scheme we will be covering model evaluation and tuning strategies in detail in so do not despair if you cannot understand some of the terminology right now the main idea here is to compare the model prediction performance between models trained on different feature sets in [ ]from sklearn linear_model import logisticregression from sklearn model_selection import cross_val_score build logistic regression model lr logisticregression(evaluating accuracy for model built on full featureset full_feat_acc np average(cross_val_score(lrbc_xbc_yscoring='accuracy'cv= )evaluating accuracy for model built on selected featureset sel_feat_acc np average(cross_val_score(lrbc_sxbc_yscoring='accuracy'cv= )print('model accuracy statistics with -fold cross validation'print('model accuracy with complete feature set'bc_x shape':'full_feat_accprint('model accuracy with selected feature set'bc_sx shape':'sel_feat_accmodel accuracy statistics with -fold cross validation model accuracy with complete feature set ( model accuracy with selected feature set ( the accuracy metrics clearly show us that we actually built better model having accuracy of when trained on the selected feature subset as compared to the model built with the original features which had an accuracy of try this out on your own datasetsdo you see any improvementsrecursive feature elimination you can also rank and score features with the help of machine learning based model estimator such that you recursively keep eliminating lower scored features till you arrive at the specific feature subset count recursive feature eliminationalso known as rfeis popular wrapper based feature selection techniquewhich allows you to use this strategy the basic idea is to start off with specific machine learning estimator like the logistic regression algorithm we used for our classification needs next we take the entire feature set of features and the corresponding response class variables rfe aims to assign weights to these features based on the model fit features with the smallest weights are pruned out and then model is fit again on