Our features are attributes that describe the flag, and some of them might not be in the right format. In this section, we will take a look at each feature and transform it if necessary.
In order to keep track of which features we have already processed, let's start defining an empty vector
namesProcessed, which contains the features that we have already processed. When we transform a feature, we add the feature name into
namesProcessed <- c()
Let's start with the numeric columns, such as
red, which have two possible outcomes:
0, in case the flag contains red and
1 otherwise. The
red variable defines an attribute, so it should be categorical instead of numeric. Then, we can convert
red into a feature that is ...