,参数n_splits设置为5,表示会做5折交叉验证;
第7行代码调用cross_val_score方法,第1个参数为模型对象,第2个参数为特征矩阵X,第3个参数为预测目标值y,第4个关键字参数cv的数据类型为整数或交叉验证对象...,参数n_splits设置为5,表示会做5折交叉验证;
第9行代码调用cross_val_score方法,第1个参数为模型对象,第2个参数为特征矩阵X,第3个参数为预测目标值y,第4个关键字参数cv的数据类型为整数或交叉验证对象...p, r, f1, s = precision_recall_fscore_support(y_true, y_pred)
# 计算总体的平均Precision, Recall, f1...u'Label': ['总体'],
u'Precision': [tot_p],
u'Recall': [tot_r],
u'F1':...f1, s = precision_recall_fscore_support(y_true, y_pred)
# 计算总体的平均Precision, Recall, f1, support