Created
April 17, 2012 11:51
-
-
Save amueller/2405542 to your computer and use it in GitHub Desktop.
weird bug
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
import numpy as np | |
from sklearn.grid_search import GridSearchCV | |
from sklearn.cross_validation import StratifiedKFold | |
from sklearn.datasets import load_iris | |
from sklearn.svm import LinearSVC | |
iris = load_iris() | |
X, y = iris.data, iris.target | |
cv = StratifiedKFold(y, 3) | |
params = dict(C=10. ** np.arange(-3, 3)) | |
grid = GridSearchCV(LinearSVC(), param_grid=params, cv=cv) | |
grid.fit(X.tolist(), y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment