Skip to content

Instantly share code, notes, and snippets.

Avatar

John DeJesus JohnDeJesus22

View GitHub Profile
@JohnDeJesus22
JohnDeJesus22 / fmi.py
Created Jul 19, 2020
fowlkes-mallows index
View fmi.py
recall = cm[1,1]/(cm[1,1] + cm[1,0])
precision = cm[1,1]/(cm[1,1] + cm[0, 1])
fmi = sqrt(precision * recall)
View prevalence_threshold.py
recall = cm[1,1]/(cm[1,1] + cm[1,0])
specificity = cm[0,0]/(cm[0,0] + cm[0,1])
numerator = sqrt(recall * (-specificity+1)) + specificity - 1
denominator = recall + specificity - 1
prevalence_threshold = numerator/denominator
@JohnDeJesus22
JohnDeJesus22 / mcc.py
Created Jul 19, 2020
Matthew's correlation coefficient
View mcc.py
numerator = (cm[1,1] * cm[0,0]) - (cm[0,1] * cm[1,0])
denominator = sqrt((cm[1,1] + cm[0,1]) * (cm[1,1] + cm[1,0]) * (cm[0,0] + cm[0,1]) * (cm[0,0] + cm[1,0]))
mcc = numerator/denominator
View markedness.py
precision = cm[1, 1]/(cm[1,1] + cm[0, 1])
negative_predictive_value = cm[0, 0]/(cm[0,0] + cm[1,0])
markedness = precision + negative_predictive_value - 1
View informedness.py
recall = cm[1, 1]/(cm[1,1] + cm[1,0])
specificity = cm[0, 0]/(cm[0,0] + cm[0,1])
informedness = recall + specificity - 1
View f_one-score.py
precision = cm[1,1]/(cm[1,1] + cm[0,1])
recall = cm[1,1]/(cm[1,1] + cm[1,0])
numerator = precision*recall
denominator = precision + recall
f1_score = 2* numerator/denominator
@JohnDeJesus22
JohnDeJesus22 / ba.py
Created Jul 18, 2020
balance accuracy
View ba.py
recall = cm[1,1]/(cm[1,1] + cm[1,0])
specificity = cm[0,0]/(cm[0,0] + cm[0,1])
balanced_accuracy = (recall + specificity)/2
@JohnDeJesus22
JohnDeJesus22 / csi.py
Created Jul 18, 2020
critical success index
View csi.py
numerator = cm[1, 1]
denominator = cm[1, 1] + cm[1, 0] + cm[0, 1]
critical_success_index = numerator/denominator
@JohnDeJesus22
JohnDeJesus22 / fmr
Created Jul 18, 2020
false omission rate
View fmr
numerator = cm[1, 0]
denominator = cm[1, 0] + cm[0, 0]
false_omission_rate = numerator/denominator
@JohnDeJesus22
JohnDeJesus22 / fdr.py
Created Jul 18, 2020
false discovery rate
View fdr.py
numerator = cm[0, 1]
denominator = cm[0, 1] + cm[1, 1]
false_discovery_rate = numerator/denominator
You can’t perform that action at this time.