Skip to content

Instantly share code, notes, and snippets.

@amueller
Created April 17, 2012 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amueller/2405542 to your computer and use it in GitHub Desktop.
Save amueller/2405542 to your computer and use it in GitHub Desktop.
weird bug
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