Tree Classifier - Focus on min_samples_split parameter

Importing Modules


In [ ]:
from sklearn import tree

Run Variables Setup If Necessary


In [ ]:
if 'features_train' not in locals() or globals():
    %run ../dev/environment_setup.ipynb

Load Tree Classifier - min_samples_split default value 2


In [ ]:
clf = tree.DecisionTreeClassifier() #if nothing is specified default value is 2

Train and Predict Data


In [ ]:
train_predict("Train and Predict Data with min_samples_split = 2")

Load Tree Classifier - min_samples_split with higher value


In [ ]:
clf = tree.DecisionTreeClassifier(min_samples_split=40)

Train and Predict Data


In [ ]:
train_predict("Train and Predict Data with min_samples_split = 40")