Skip to content

Instantly share code, notes, and snippets.

@samyumobi
Created October 5, 2021 11:57
Show Gist options
  • Select an option

  • Save samyumobi/3c89e557a2b1a6a3cc0dd8f47e4e8791 to your computer and use it in GitHub Desktop.

Select an option

Save samyumobi/3c89e557a2b1a6a3cc0dd8f47e4e8791 to your computer and use it in GitHub Desktop.
Sklearn Logistic regression code snippet
from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
X, y = load_iris()
clf = LogisticRegression(random_state = 0).fit(X,y)
clf.predict(X[:2,:])
clf.predict_proba(X[:2,:])
clf.score(X,y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment