import numpy as npfrom sklearn import svmfrom sklearn import datasetsfrom sklearn import metricsfrom sklearn import model_selectionimport matplotlibpyplot as pltiris = datasetsload_irisx y = irisdatai
SVM-输出训练集的准确率为: 0.975 SVM-输出测试集的准确率为: 0.9666666666666667 precision recall f1-score support
0 1.00 1.00 1.00 11
1 0.92 1.00 0.96 11
2 1.00 0.92 0.96 8
accuracy 0.97 30
macro avg 0.97 0.97 0.97 30 weighted avg 0.97 0.97 0.97 30
原文地址: https://www.cveoy.top/t/topic/hECN 著作权归作者所有。请勿转载和采集!