Python 让我们回顾一下凯拉斯的历史
我正在用Python 让我们回顾一下凯拉斯的历史,python,machine-learning,keras,deep-learning,mlp,Python,Machine Learning,Keras,Deep Learning,Mlp,我正在用 metrics=["accuracy", keras.metrics.Recall()] 如文件中所述。但当我在训练模型后试图获得它时,我得到了一个关键错误“回忆”。两个版本 recall = estimator_bio.history["Recall"] recall = estimator_bio.history["recall"] 导致 KeyError: 'Recall' 当 工作。召回的关键字是什么?您始终可以
metrics=["accuracy", keras.metrics.Recall()]
如文件中所述。但当我在训练模型后试图获得它时,我得到了一个关键错误“回忆”。两个版本
recall = estimator_bio.history["Recall"]
recall = estimator_bio.history["recall"]
导致
KeyError: 'Recall'
当
工作。召回的关键字是什么?您始终可以向指标传递名称:
metrics=["accuracy", keras.metrics.Recall(name='recall')]
这样你就可以很容易地引用它
无论如何,您应该打印或检查历史对象的内容,以查看它包含的内容以及分配给调用
(顺便说一下,应该是调用
)的实际键/名称
通常你要做的是:
# Fit the model
history = model.fit(.....)
# and then you can see what is available in the history with:
print(history.history.keys())
# Fit the model
history = model.fit(.....)
# and then you can see what is available in the history with:
print(history.history.keys())