Created
March 24, 2013 17:20
-
-
Save paulgb/5232709 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn import preprocessing, pipeline | |
label_enc = preprocessing.LabelEncoder() | |
pipe = pipeline.Pipeline([('enc', label_enc)]) | |
X = ['foo', 'bar', 'baz'] | |
label_enc.fit(X) # works | |
pipe.fit(X) # fails w/ output below | |
''' | |
Output: | |
Traceback (most recent call last): | |
File "pipetest.py", line 9, in <module> | |
pipe.fit(X) | |
File "/Library/Python/2.7/site-packages/sklearn/pipeline.py", line 128, in fit | |
self.steps[-1][-1].fit(Xt, y, **fit_params) | |
TypeError: fit() takes exactly 2 arguments (3 given) | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment