February 2018
Intermediate to advanced
378 pages
10h 14m
English
Let's learn how to train the decision tree classifier as shown in the following code snippet:
In []:
from sklearn import tree
tree_model = tree.DecisionTreeClassifier(criterion='entropy', random_state=42)
tree_model = tree_model.fit(X_train, y_train)
tree_model
Out[]:
DecisionTreeClassifier(class_weight=None,
criterion='entropy', max_depth=None,
max_features=None, max_leaf_nodes=None,
min_impurity_split=1e-07, min_samples_leaf=1,
min_samples_split=2, min_weight_fraction_leaf=0.0,
presort=False, random_state=42, splitter='best')
The most interesting for us are the class attributes of DecisionTreeClassifier:
Read now
Unlock full access