如何在多标签分类器上使用scikit-learn的交叉验证功能
我正在一个5个类的数据集上测试不同的分类器,每个实例可以属于一个或多个这些类,因此我正在使用scikit-learn的多标签分类器sklearn.multiclass.OneVsRestClassifier。现在,我想使用进行交叉验证sklearn.cross_validation.StratifiedKFold。这将产生以下错误: Traceback (most recent call last): File "mlfromcsv.py", line 93, in <module> main() File "mlfromcsv.py", line 77, in main test_classifier_multilabel(svm.LinearSVC(), X, Y, 'Linear Support Vector Machine') File "mlfromcsv.py", line 44, in test_classifier_multilabel scores = cross_validation.cross_val_score(clf_ml, X, Y_list, cv=cv, score_func=metrics.precision_recall_fscore_support, n_jobs=jobs) File "/usr/lib/pymodules/python2.7/sklearn/cross_validation.py", line 1046, in cross_val_score X, y = check_arrays(X, …