简体   繁体   English

如何在迁移学习 vgg16 模型中获得准确率、召回率、f1 分数?

[英]How to get precision, recall, f1 score in transfer learning vgg16 model?

How to to get the precision, recall, confusion matrix, and f1 score?如何获得精度、召回率、混淆矩阵和 f1 分数? I am new in deep learning.我是深度学习的新手。 Anyone give me a resource or help me to find the information.任何人都可以给我资源或帮助我查找信息。

Import the modules from sklearn :sklearn导入模块:

from sklearn.metrics import classification_report, confusion_matrix

Assuming your test set explanatory variables are contained in X_test , the response variables in y_test , and your model is named model , predict the values for the test set:假设你的测试集的解释变量包含在X_test ,在响应变量y_test ,和你的模型被命名为model ,预测了测试设置的值:

y_pred = model.predict(X_test)

And then print the classification report and confusion matrix:然后打印分类报告和混淆矩阵:

print(classification_report(y_test, y_pred))
print(confusion_matrix(y_test, y_pred))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 VGG16 Model 输出尺寸不正确 - 迁移学习 - VGG16 Model Outputs Incorrect dimension - Transfer Learning 使用自制分离器获得精确度、召回率、F1 分数 - Get Precision, Recall, F1 Score with self-made splitter VGG16转移学习不同的输出 - VGG16 Transfer Learning varying output 如何找出在 Python 中网格搜索中选择的最佳 model 的精度、召回率、特异性和 F1 分数? - How to find out precision, recall, specificity & F1 score of the best model which is selected in Grid Search in Python? 如何计算 python 中平衡逻辑回归 model 的精度、召回率和 f1 分数 - How to compute precision,recall and f1 score of an balanced logistic regression model in python 如何在训练 SSD 后预测 Precision、Recall 和 F1 分数 - How to predict Precision, Recall and F1 score after training SSD 如何找到我的 word2vec model 的准确度、精确度、召回率和 f1 分数? - How to find accuracy, precision, recall, f1 score for my word2vec model? 精度,召回率,F1得分与sklearn相等 - Precision, recall, F1 score equal with sklearn Tensorflow:计算精度、召回率、F1 分数 - Tensorflow: Compute Precision, Recall, F1 Score 无法使用 VGG16 预训练模型实现多类迁移学习 - Unable to implement the multi class transfer learning using VGG16 pre-trained model
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM