如何使用 python 检索从混淆矩阵中获取的假阴性值:
Tn:27, FP=0, FN=7, TP=6
任何帮助将不胜感激:
idx = X[np.where(y_test != y_pred)[0]].sum(axis=1)
np.array(corpus)[idx] # I have tried this I could not able to get those.
idx=X[np.where(y_test != y_pred)[0]].sum(axis=1)
np.array(corpus)[idx]
Tp-6 TN-27 FP=0 FN=7
我想检索假阴性值。我从上面的代码中获取了所有误报和误报值,但我试图仅检索误报值。
最佳答案
您可以使用 bool 索引来获取假负值
## get boolean indexes for false negetive
fn_ind = (y_pred==False) & (y_pred != y_test)
fn_rows = X[fn_ind]
关于用于检索假负值的 Python 编程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58054941/