Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scikit-learn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ian Johnson
scikit-learn
Commits
e157a455
Commit
e157a455
authored
14 years ago
by
Gael Varoquaux
Browse files
Options
Downloads
Patches
Plain Diff
BUG: Fix doctests in pipeline.py
parent
a3bd4197
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
scikits/learn/pipeline.py
+8
-7
8 additions, 7 deletions
scikits/learn/pipeline.py
with
8 additions
and
7 deletions
scikits/learn/pipeline.py
+
8
−
7
View file @
e157a455
...
...
@@ -12,19 +12,20 @@ class Pipeline(BaseEstimator):
>>>
from
scikits.learn
import
svm
,
datasets
>>>
from
scikits.learn.datasets
import
samples_generator
>>>
from
scikits.learn.feature_selection
.univariate_selection
import
UnivariateFilter
,
SelectKBest
,
f_regression
>>>
from
scikits.learn.feature_selection
import
SelectKBest
,
f_regression
>>>
from
scikits.learn.pipeline
import
Pipeline
>>>
#
import
some data to play with
>>>
#
generate
some data to play with
>>>
X
,
y
=
samples_generator
.
test_dataset_classif
(
k
=
5
)
>>>
# ANOVA SVM-C
>>>
anova_filter
=
UnivariateFilter
(
SelectKBest
(
k
=
5
),
f_regression
)
>>>
anova_filter
=
SelectKBest
(
f_regression
,
k
=
5
)
>>>
clf
=
svm
.
SVC
(
kernel
=
'
linear
'
)
>>>
anova_svm
=
Pipeline
([
anova_filter
],
clf
)
>>>
anova_svm
.
fit
(
X
,
y
)
>>>
anova_svm
.
predict
(
X
)
>>>
_
=
anova_svm
.
fit
(
X
,
y
)
>>>
prediction
=
anova_svm
.
predict
(
X
)
"""
def
__init__
(
self
,
transformers
=
[],
estimator
=
None
):
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment