TP=k.iloc[1,1]
TN=k.iloc[0,0]
FP=k.iloc[0,1]
FN=k.iloc[1,0]
P=TP+FN
N=TN+FP
print('Accuracy is :',(TP+TN)/(P+N))
print('Sensitivity is :',TP/P)
print('Specificity is :',TN/N)
Точность: нан.
Чувствительность: нан.
Специфичность: нан.
C:\Users\somya\Anaconda3\lib\site-packages\ipykernel_launcher.py:9: RuntimeWarning: invalid value encountered in longlong_scalars
if __name__ == '__main__':
C:\Users\somya\Anaconda3\lib\site-packages\ipykernel_launcher.py:10: RuntimeWarning: invalid value encountered in longlong_scalars
# Remove the CWD from sys.path while we load stuff.
C:\Users\somya\Anaconda3\lib\site-packages\ipykernel_launcher.py:11:
RuntimeWarning: invalid value encountered in longlong_scalars
# This is added back by InteractiveShellApp.init_path()