8000 DOC: use notebook-style for plot_svm_regression.py example (#22534) · thomasjpfan/scikit-learn@23a09e9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 23a09e9

Browse files
jayasuryajsklesteve
authored andcommitted
DOC: use notebook-style for plot_svm_regression.py example (scikit-learn#22534)
Co-authored-by: Loïc Estève <loic.esteve@ymail.com>
1 parent 966c42a commit 23a09e9

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

examples/svm/plot_svm_regression.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,25 @@
1111
from sklearn.svm import SVR
1212
import matplotlib.pyplot as plt
1313

14-
# #############################################################################
14+
# %%
1515
# Generate sample data
16+
# --------------------
1617
X = np.sort(5 * np.random.rand(40, 1), axis=0)
1718
y = np.sin(X).ravel()
1819

19-
# #############################################################################
20-
# Add noise to targets
20+
# add noise to targets
2121
y[::5] += 3 * (0.5 - np.random.rand(8))
2222

23-
# #############################################################################
23+
# %%
2424
# Fit regression model
25+
# --------------------
2526
svr_rbf = SVR(kernel="rbf", C=100, gamma=0.1, epsilon=0.1)
2627
svr_lin = SVR(kernel="linear", C=100, gamma="auto")
2728
svr_poly = SVR(kernel="poly", C=100, gamma="auto", degree=3, epsilon=0.1, coef0=1)
2829

29-
# #############################################################################
30+
# %%
3031
# Look at the results
32+
# -------------------
3133
lw = 2
3234

3335
svrs = [svr_rbf, svr_lin, svr_poly]

0 commit comments

Comments
 (0)
0