gpt4 book ai didi

用于检索假负值的 Python 编程

转载 作者:太空宇宙 更新时间:2023-11-03 20:22:38 28 4
gpt4 key购买 nike

如何使用 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/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com