8000 DOC example rendering · shidaitimes/scikit-learn@faba875 · GitHub
[go: up one dir, main page]

Skip to content

Commit faba875

Browse files
committed
DOC example rendering
1 parent 3bc3d9f commit faba875

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

sklearn/pipeline.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,19 @@ class Pipeline(BaseEstimator):
5353
>>> from sklearn.feature_selection import SelectKBest
5454
>>> from sklearn.feature_selection import f_regression
5555
>>> from sklearn.pipeline import Pipeline
56-
5756
>>> # generate some data to play with
5857
>>> X, y = samples_generator.make_classification(
5958
... n_informative=5, n_redundant=0, random_state=42)
60-
6159
>>> # ANOVA SVM-C
6260
>>> anova_filter = SelectKBest(f_regression, k=5)
6361
>>> clf = svm.SVC(kernel='linear')
6462
>>> anova_svm = Pipeline([('anova', anova_filter), ('svc', clf)])
65-
6663
>>> # You can set the parameters using the names issued
6764
>>> # For instance, fit using a k of 10 in the SelectKBest
6865
>>> # and a parameter 'C' of the svm
6966
>>> anova_svm.set_params(anova__k=10, svc__C=.1).fit(X, y)
7067
... # doctest: +ELLIPSIS
7168
Pipeline(steps=[...])
72-
7369
>>> prediction = anova_svm.predict(X)
7470
>>> anova_svm.score(X, y) # doctest: +ELLIPSIS
7571
0.77...

0 commit comments

Comments
 (0)
0