Skip to content

Commit 065fca0

Browse files
committed
Merge pull request scikit-learn#2789 from ugurthemaster/patch-2
Update plot_tree_regression_multioutput.py
2 parents f8e7cf1 + 8e162a0 commit 065fca0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

examples/tree/plot_tree_regression_multioutput.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
print(__doc__)
1818

1919
import numpy as np
20+
import pylab as pl
21+
from sklearn.tree import DecisionTreeRegressor
2022

2123
# Create a random dataset
2224
rng = np.random.RandomState(1)
@@ -25,8 +27,6 @@
2527
y[::5, :] += (0.5 - rng.rand(20, 2))
2628

2729
# Fit regression model
28-
from sklearn.tree import DecisionTreeRegressor
29-
3030
clf_1 = DecisionTreeRegressor(max_depth=2)
3131
clf_2 = DecisionTreeRegressor(max_depth=5)
3232
clf_3 = DecisionTreeRegressor(max_depth=8)
@@ -41,8 +41,6 @@
4141
y_3 = clf_3.predict(X_test)
4242

4343
# Plot the results
44-
import pylab as pl
45-
4644
pl.figure()
4745
pl.scatter(y[:, 0], y[:, 1], c="k", label="data")
4846
pl.scatter(y_1[:, 0], y_1[:, 1], c="g", label="max_depth=2")

0 commit comments

Comments
 (0)