Last active
May 25, 2020 15:33
-
-
Save codeperfectplus/1a04f8046e72a920c71f2d60bfefd92a to your computer and use it in GitHub Desktop.
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.model_selection import train_test_split | |
from sklearn.linear_model import LogisticRegression | |
from sklearn.metrics import confusion_matrix | |
iris = load_iris() | |
X = iris.data | |
y = iris.target | |
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=24) | |
clf = LogisticRegression().fit(X_train, y_train) | |
y_predict = clf.predict(X_test) | |
cMatrix = confusion_matrix(y_test, y_predict) | |
print(cMatrix) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment