表示样本的真实类别# pre_labels: 预测标签列表,表示模型预测的样本类别print('单独计算的准确率、精确率、F1分数和召回率:')# 1. accuracy_score: 准确率,表示预测正确的样本占总样本的比例print('accuracy_score:',accuracy_score(real_labels,pre_labels))# 2. precision_score: 精确率,表示预测...
表示样本的真实类别# pre_labels: 预测标签列表,表示模型预测的样本类别print('单独计算的准确率、精确率、F1分数和召回率:')# 1. accuracy_score: 准确率,表示预测正确的样本占总样本的比例print('accuracy_score:',accuracy_score(real_labels, pre_labels))# 2. precision_score: 精确率,表示...
print('precision_score:',precision_score(real_labels, pre_labels, average='macro')) # 3. f1_score: F1分数,是精确率和召回率的调和平均值,综合评估精确度和召回率 print('f1_score:',f1_score(real_labels, pre_labels, average='macro')) # 4. recall_score: 召回率,表示预测为正类且实际为正...
表示样本的真实类别# pre_labels: 预测标签列表,表示模型预测的样本类别print('单独计算的准确率、精确率、F1分数和召回率:')# 1. accuracy_score: 准确率,表示预测正确的样本占总样本的比例print('accuracy_score:',accuracy_score(real_labels, pre_labels))# 2. precision_score: 精确率,表示...