Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions notebooks/helpers_05_08.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

import numpy as np
import matplotlib.pyplot as plt
from sklearn.tree import DecisionTreeClassifier
from ipywidgets import interact
""" IMPORT THE LIBRARIES REQUIRED """
import numpy as np import matplotlib.pyplot as plt from sklearn.tree
import DecisionTreeClassifier from ipywidgets import interact


""" FUNCTION TO PLOT THE GRAPHS """
def visualize_tree(estimator, X, y, boundaries=True,
xlim=None, ylim=None, ax=None):
ax = ax or plt.gca()
Expand Down Expand Up @@ -80,4 +79,4 @@ def fit_randomized_tree(random_state=0):
visualize_tree(clf, X[i[:N]], y[i[:N]], boundaries=False,
xlim=xlim, ylim=ylim)

interact(fit_randomized_tree, random_state=[0, 100]);
interact(fit_randomized_tree, random_state=[0, 100]);