Skip to content

Commit

Permalink
add sklearn reference
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamWu96 committed Oct 21, 2022
1 parent 16b619e commit 78a4f30
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Part_2/5_sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# coding: utf-8

# In[2]:
# import os

# https://scikit-learn.org/stable/user_guide.html
from sklearn import datasets
dataset = datasets.load_iris()
#dataset = datasets.load_digits()
Expand Down Expand Up @@ -39,6 +39,7 @@
y_pred = tree.predict(X_test)
print("Predictive outputs of all instances:\n%s"%y_pred)

# what is confusion matrix: https://towardsdatascience.com/understanding-confusion-matrix-a9ad42dcfd62
from sklearn.metrics import classification_report, confusion_matrix
print("Confusion Matrix:\n%s"%confusion_matrix(y_test, y_pred))
print("Classification Report:\n%s"%classification_report(y_test, y_pred))
Expand Down

0 comments on commit 78a4f30

Please sign in to comment.