This file contains 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
#https://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_curve.html | |
from sklearn.metrics import roc_curve | |
y_true = np.array([1, 1, 2, 2]) | |
y_pred = np.array([0.1, 0.4, 0.35, 0.8]) | |
#pos_label é onde indica-se o valor da classe de interesse | |
fpr, tpr, thresholds = metrics.roc_curve(y, scores, pos_label=2) |
This file contains 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_breast_cancer | |
data = load_breast_cancer() | |
list(data.target_names) | |
#>>> ['malignant', 'benign'] |
This file contains 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.metrics import confusion_matrix | |
print( confusion_matrix(y_predito, y_real) ) |
This file contains 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
Previstos |
---|