Skip to content

Instantly share code, notes, and snippets.

@shantanuo
Forked from sahil280114/model.py
Created October 9, 2019 05:33
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 shantanuo/8073410930cf5389855c0235ce4b6a40 to your computer and use it in GitHub Desktop.
Save shantanuo/8073410930cf5389855c0235ce4b6a40 to your computer and use it in GitHub Desktop.
clf = Pipeline([("dct", DictVectorizer()), ("svc", LinearSVC())])
params = {
"svc__C": [1e15, 1e13, 1e11, 1e9, 1e7, 1e5, 1e3, 1e1, 1e-1, 1e-3, 1e-5]
}
gs = GridSearchCV(clf, params, cv=10, verbose=2, n_jobs=-1)
gs.fit(X, y)
model = gs.best_estimator_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment