Skip to content

Commit b929656

Browse files
author
ugurthemaster
committed
Update plot_adaboost_regression.py
Library imports have been moved to top of the file.
1 parent 6a7786a commit b929656

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/ensemble/plot_adaboost_regression.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@
1818
#
1919
# License: BSD 3 clause
2020

21+
# importing necessary libraries
2122
import numpy as np
2223
import matplotlib.pyplot as plt
24+
from sklearn.tree import DecisionTreeRegressor
25+
from sklearn.ensemble import AdaBoostRegressor
2326

2427
# Create a the dataset
2528
rng = np.random.RandomState(1)
2629
X = np.linspace(0, 6, 100)[:, np.newaxis]
2730
y = np.sin(X).ravel() + np.sin(6 * X).ravel() + rng.normal(0, 0.1, X.shape[0])
2831

2932
# Fit regression model
30-
from sklearn.tree import DecisionTreeRegressor
31-
from sklearn.ensemble import AdaBoostRegressor
32-
3333
clf_1 = DecisionTreeRegressor(max_depth=4)
3434

3535
clf_2 = AdaBoostRegressor(DecisionTreeRegressor(max_depth=4),

0 commit comments

Comments
 (0)