Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

get false positives from confusoin matrix

FP = confusion_matrix.sum(axis=0) - np.diag(confusion_matrix)  
FN = confusion_matrix.sum(axis=1) - np.diag(confusion_matrix)
TP = np.diag(confusion_matrix)
TN = confusion_matrix.values.sum() - (FP + FN + TP)

# Sensitivity, hit rate, recall, or true positive rate
TPR = TP/(TP+FN)
# Specificity or true negative rate
TNR = TN/(TN+FP) 
# Precision or positive predictive value
PPV = TP/(TP+FP)
# Negative predictive value
NPV = TN/(TN+FN)
# Fall out or false positive rate
FPR = FP/(FP+TN)
# False negative rate
FNR = FN/(TP+FN)
# False discovery rate
FDR = FP/(TP+FP)

# Overall accuracy
ACC = (TP+TN)/(TP+FP+FN+TN)
Comment

PREVIOUS NEXT
Code Example
Python :: what if init migrations run two times or by pass this migrate 
Python :: read file in python 
Python :: micropython free space esp32 esp2866 
Python :: check if number is divisible without remainder python 
Python :: leetcode 206 python 
Python :: grepper how to use fraction 
Python :: python check if more than 1 is true 
Python :: how to remove no data times plotly 
Python :: matplotlib set dpi 300 
Python :: check if a date is reached django 
Python :: numpy split to chunks of equal size 
Python :: pytest runtimeerror: no application found. either work inside a view function or push an application context 
Python :: how to set conditionlally keys in python 
Python :: tkinter mouse loading cursor 
Python :: unction which takes in a list of integers and returns a dictionary of the five number summary.. 
Python :: same quotes in a quotes 
Python :: python three periods 
Python :: concat with zero array numpy 
Python :: python get unicode spaces 
Python :: plt force axis numbers 
Python :: como usar o Self no python 
Python :: pandas df where 
Python :: if python 
Python :: inverting a dictionary 
Python :: how to add colors in python 
Python :: python destructor 
Python :: python string: .find() 
Python :: fizz buzz fizzbuzz python game 
Python :: id() python 
Python :: reduce () in python 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =