Calling the ID3 method
Now with the training function loaded with data, our next step should be to create the decision tree itself. We can do this by calling on the modules provided by the decision tree library and passing in the module that we want to use. We're going to leverage the ID3 algorithm for this example. The ID3 tree is a popular decision-making algorithm, which will give us access to its functions.
After calling the ID3 algorithm, we need to instantiate a new decision tree and pass in the first argument, which is attributes. With this, we pass in the training data and the default will be set as sick. All of this will be set to :continuous, which indicates that we are setting the decision tree to run continuously. Your decision ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access