Skip to content

Instantly share code, notes, and snippets.

@LucasOliveiraS
Last active November 13, 2019 14:04
Show Gist options
  • Select an option

  • Save LucasOliveiraS/0a15c48e391f351b77d62e4523927e3e to your computer and use it in GitHub Desktop.

Select an option

Save LucasOliveiraS/0a15c48e391f351b77d62e4523927e3e to your computer and use it in GitHub Desktop.
from sklearn.linear_model import SGDClassifier
X = np.array([[0,0], [0,1]])
y = np.array([[0], [1]])
clf = SGDClassifier(loss="hinge", penalty="l2")
clf.fit(X, y)
X_new = np.array([[1,0], [1,1]])
y_new = np.array([[1], [0]])
clf.partial_fit(X_new,y_new)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment