是否可以帮助我解释为什么来自scikit的cross_val_score
学习不考虑scoring
参数?我一定做错了,我真的找不到。
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split, cross_val_score
from sklearn import svm
data = load_iris()
precisions = cross_val_score(svm.SVC(), data['data'], data['target'], cv=4, scoring="precision_micro")
recalls = cross_val_score(svm.SVC(), data['data'], data['target'], cv=4, scoring="recall_micro")
accuracies = cross_val_score(svm.SVC(), data['data'], data['target'], cv=4, scoring="accuracy")
print(precisions)
print(recalls)
print(accuracies)
返回:
[ 0.97435897 1. 0.94444444 0.97222222]
[ 0.97435897 1. 0.94444444 0.97222222]
[ 0.97435897 1. 0.94444444 0.97222222]