Skip to content

Commit 3a4edd0

Browse files
committed
Merge pull request scikit-learn#2936 from ugurthemaster/master
Update plot_svm_regression.py
2 parents ffc0fa6 + c8a372b commit 3a4edd0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

examples/svm/plot_svm_regression.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
"""
99
print(__doc__)
1010

11-
###############################################################################
12-
# Generate sample data
1311
import numpy as np
12+
from sklearn.svm import SVR
13+
import pylab as pl
1414

15+
###############################################################################
16+
# Generate sample data
1517
X = np.sort(5 * np.random.rand(40, 1), axis=0)
1618
y = np.sin(X).ravel()
1719

@@ -21,8 +23,6 @@
2123

2224
###############################################################################
2325
# Fit regression model
24-
from sklearn.svm import SVR
25-
2626
svr_rbf = SVR(kernel='rbf', C=1e3, gamma=0.1)
2727
svr_lin = SVR(kernel='linear', C=1e3)
2828
svr_poly = SVR(kernel='poly', C=1e3, degree=2)
@@ -32,7 +32,6 @@
3232

3333
###############################################################################
3434
# look at the results
35-
import pylab as pl
3635
pl.scatter(X, y, c='k', label='data')
3736
pl.hold('on')
3837
pl.plot(X, y_rbf, c='g', label='RBF model')

0 commit comments

Comments
 (0)