Created
October 5, 2021 11:57
-
-
Save samyumobi/3c89e557a2b1a6a3cc0dd8f47e4e8791 to your computer and use it in GitHub Desktop.
Sklearn Logistic regression code snippet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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