Creating a Decision Tree Classifier

Abhishek Mishra · 2020

This chapter explains how to create a decision tree classification model that can be used to classify Iris flowers. It uses the Iris flowers dataset hosted at the UCI Machine Learning repository. The dataset consists of 150 samples that represent Iris flowers from three classes—Iris Setosa, Iris Virginica, and Iris Versicolor—with 50 samples each. The chapter explains how to split the 150-row dataset into a training and test set. The training set is used to train the model, and the test set is used to evaluate the model. Scikit-learn provides a function called train_test_ split() in the model_selection submodule that can be used to split a Pandas dataframe into two dataframes, one for model building and the other for model evaluation. Core ML tools is an open source Python package provided by Apple that can be used to convert models made using libraries like Scikit-learn into the Core ML format.

Read the paper · More papers on PaperTik