Page 106 - Data Science Algorithms in a Week
P. 106
Random Forest
Cold,None,Sunny,Yes
Hot,Strong,Cloudy,Yes
Warm,None,Cloudy,Yes
Warm,Strong,Sunny,?
Output:
We produce the output by executing on the command line:
$ python random_forest.py chess.csv 4 2 > chess.out
The number 4 here means that we want to construct four decision trees and 2 is the level of
the verbosity of the program which includes the explanations of a tree is constructed. The
last part > chess.out means that the output is written to the file chess.out. This file can
be found in the chapter directory source_code/4. We do not put all the output here, as it
is very large and repetitive. Instead some of it was included in the preceding analysis and
construction of a random forest.
Going shopping - overcoming data
inconsistency with randomness and
measuring the level of confidence
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 ?
[ 94 ]