Skip to content

Instantly share code, notes, and snippets.

@ResidentMario
Created March 14, 2019 22:39
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 ResidentMario/8410d0daf51b417145b970ed5fedf64e to your computer and use it in GitHub Desktop.
Save ResidentMario/8410d0daf51b417145b970ed5fedf64e to your computer and use it in GitHub Desktop.
# import a classifier object
from sklearn.svm import LinearSVC
# initialize it with hyperparameters
clf = LinearSVC(penalty='l2', loss='hinge')
# call fit on data to train the model
clf.fit(X, y)
# call predict to get predictions
y_pred = clf.predict(y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment