concept feature selection in category R

This is an excerpt from Manning's book Machine Learning with R, the tidyverse, and mlr.
Feature selection is the process of choosing which variables in a dataset have predictive value for machine learning models.
By the end of this chapter, I hope you’ll understand a general approach to regression problems with mlr, and how this differs from classification. In particular, you’ll understand the different performance metrics we use for regression tasks, because mean misclassification error (MMCE) is no longer meaningful. I’ll also show you, as I promised in chapter 4, more sophisticated approaches to missing value imputation and feature selection. Finally, I’ll cover how to combine as many preprocessing steps as we like using sequential wrappers, so we can include them in our cross-validation.
Sometimes it may be obvious which variables have no predictive value and can be removed from the analysis. Domain knowledge is also very important here, where we include variables in the model that we, as experts, believe to have some predictive value for the outcome we’re studying. But it’s often better to take a less subjective approach to feature selection, and allow an algorithm to choose the relevant features for us. In this section, I’ll show you how we can implement this in mlr.
There are two methods for automating feature selection:
Listing 9.6. Using a filter method for feature selection
filterVals <- generateFilterValuesData(ozoneTask, method = "linear.correlation") filterVals$data name type linear.correlation 1 Month numeric 0.053714 2 Date numeric 0.082051 3 Day numeric 0.041514 4 Press_height numeric 0.587524 5 Wind numeric 0.004681 6 Humid numeric 0.451481 7 Temp_Sand numeric 0.769777 8 Temp_Monte numeric 0.741590 9 Inv_height numeric 0.575634 10 Press_grad numeric 0.233318 11 Inv_temp numeric 0.727127 12 Visib numeric 0.414715 plotFilterValues(filterVals) + theme_bw()