We take the problem from the previous chapter. We have the following data about the shopping preferences of our friend, Jane:
Temperature |
Rain |
Shopping |
Cold |
None |
Yes |
Warm |
None |
No |
Cold |
Strong |
Yes |
Cold |
None |
No |
Warm |
Strong |
No |
Warm |
None |
Yes |
Cold |
None |
? |
In the previous chapter, decision trees were not able to classify the feature (Cold, None). So, this time, we would like to find, using the random forest algorithm, whether Jane would go shopping if the outside temperature was cold and there was no rain.
Analysis:
To perform the analysis with the random forest algorithm we use the implemented program.
Input:
We put the data from the table into the CSV file:
# source_code/4/shopping.csv Temperature,Rain,Shopping Cold...