Another machine learning method – decision trees
In Chapter 11, we trained a machine learning model using Naïve Bayes. At the time, we mentioned that we only needed to change one line to swap in other machine learning methods. If you take a look at the 12_tree.ipynb
notebook on the book’s GitHub page, you’ll see we’ve done exactly that. The line we create our classifier in the notebook now reads as follows:
model = PMMLPipeline([( "
classifier", DecisionTreeClassifier(),)])
Running the notebook in Azure or another notebook hosting option is the same as in the previous chapter, so we won’t repeat ourselves. More importantly, when you run the notebook, you get a prediction graph, as shown in Figure 12.1:
Figure 12.1 – Predictions from the decision tree model
Compare this result to Figure 11.16 in the previous chapter. While the predictions are broadly similar, they are not as fine grained. This...