Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

sensitivity

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 :: 123bum123 
Python :: how to convrete .npz file to txt file in python 
Python :: Python NumPy asmatrix Function Syntax 
Python :: Python NumPy ascontiguousarray Function Example List to an array 
Python :: Python NumPy require Function Example without requirements attribute 
Python :: Python NumPy hstack Function Example with 1d array 
Python :: python function arguments multiple lines 
Python :: watchlist flask app 
Python :: Python NumPy vsplit Function Syntax 
Python :: mid point line drawing 
Python :: Python __ge__ 
Python :: Exception has occurred: FileNotFoundError 
Python :: hide ticks without hiding grid 
Python :: ignopre rankwarning pyton 
Python :: NumPy packbits Code Packed array along axis 1 
Python :: should either include a `queryset` attribute, 
Python :: lambda to redshift python 
Python :: penggunaan keys di python 
Python :: python replace date time column 
Python :: for loop for calendar day selection using selenium python 
Python :: qmenu 
Python :: what does scalar.fit do 
Python :: how to access specific index of matrix in python 
Python :: How to correctly call url_for and specify path parameters 
Python :: python QFileDialog select files 
Python :: best website to learn python 
Python :: dictionary, accepting similar words solution 
Python :: Hiding and encrypting passwords in Python? 
Python :: size of variable 
Python :: how to execute more than one line of code in one line python 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =