April 2017
Beginner to intermediate
358 pages
9h 30m
English
We can import the DecisionTreeClassifier class and create a Decision Tree using scikit-learn:
from sklearn.tree import DecisionTreeClassifierclf = DecisionTreeClassifier(random_state=14)
We now need to extract the dataset from our pandas data frame in order to use it with our scikit-learn classifier. We do this by specifying the columns we wish to use and using the values parameter of a view of the data frame. The following code creates ...
Read now
Unlock full access