File tree Expand file tree Collapse file tree 1 file changed +0
-4
lines changed Expand file tree Collapse file tree 1 file changed +0
-4
lines changed Original file line number Diff line number Diff line change @@ -53,23 +53,19 @@ class Pipeline(BaseEstimator):
53
53
>>> from sklearn.feature_selection import SelectKBest
54
54
>>> from sklearn.feature_selection import f_regression
55
55
>>> from sklearn.pipeline import Pipeline
56
-
57
56
>>> # generate some data to play with
58
57
>>> X, y = samples_generator.make_classification(
59
58
... n_informative=5, n_redundant=0, random_state=42)
60
-
61
59
>>> # ANOVA SVM-C
62
60
>>> anova_filter = SelectKBest(f_regression, k=5)
63
61
>>> clf = svm.SVC(kernel='linear')
64
62
>>> anova_svm = Pipeline([('anova', anova_filter), ('svc', clf)])
65
-
66
63
>>> # You can set the parameters using the names issued
67
64
>>> # For instance, fit using a k of 10 in the SelectKBest
68
65
>>> # and a parameter 'C' of the svm
69
66
>>> anova_svm.set_params(anova__k=10, svc__C=.1).fit(X, y)
70
67
... # doctest: +ELLIPSIS
71
68
Pipeline(steps=[...])
72
-
73
69
>>> prediction = anova_svm.predict(X)
74
70
>>> anova_svm.score(X, y) # doctest: +ELLIPSIS
75
71
0.77...
You can’t perform that action at this time.
0 commit comments