January 2020
Beginner to intermediate
432 pages
11h 24m
English
Execute the following steps to fit a decision tree classifier.
from sklearn.tree import DecisionTreeClassifier, export_graphvizfrom sklearn import metricsfrom chapter_8_utils import performance_evaluation_reportfrom io import StringIOimport seaborn as snsfrom ipywidgets import Imageimport pydotplus
tree_classifier = DecisionTreeClassifier()tree_classifier.fit(X_train_ohe, y_train)y_pred = tree_classifier.predict(X_test_ohe)
LABELS = ['No Default', 'Default']tree_perf = performance_evaluation_report(tree_classifier, X_test_ohe, y_test, labels=LABELS, show_plot=True)
Running the code ...
Read now
Unlock full access