O'Reilly logo

R Machine Learning Essentials by Michele Usuelli

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exploring and visualizing the features

After having defined the features, we can explore them and identify how they are related to the problem. In this section, you will see how to explore the data and define some simple charts.

Let's start with a feature, for instance, mainhue, which displays the predominant color of a flag. We want to identify the most common predominant colors, and for that purpose, we can use table to count the number of occurrences of each possible value. We can extract the mainhue column from dtFlag and apply table to it:

table(dtFlag[, mainhue])
black   blue  brown   gold  green orange    red  white 
     5     40      2     19     31      4     71     22

The three most common predominant colors are red, blue, and green. Please note that we could have put table inside ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required