Matlab 不平衡数据的LibSVM成本权重不';行不通

Matlab 不平衡数据的LibSVM成本权重不';行不通,matlab,machine-learning,svm,libsvm,Matlab,Machine Learning,Svm,Libsvm,我有一个数据集,负标签值的数量是正标签值数量的163倍,所以我有一个不平衡的数据集。我试过: model = svmtrain(trainLabels, trainFeatures, '-h 0 -b 1 -s 0 -c 10 -w1 163 -w-1 1'); [predicted_label, accuracy, prob_estimates] = svmpredict(testLabels, testFeatures, model, '-b 1'); 准确率接近99%,我搜索发现:在第7

我有一个数据集,负标签值的数量是正标签值数量的163倍,所以我有一个不平衡的数据集。我试过:

model = svmtrain(trainLabels, trainFeatures, '-h 0 -b 1 -s 0 -c 10 -w1 163 -w-1 1');
[predicted_label, accuracy, prob_estimates] = svmpredict(testLabels, testFeatures, model, '-b 1');
准确率接近99%,我搜索发现:在第7篇文章中写道


你是否尝试过在较小的范围内加权(即:这可能是因为你的负面和正面例子很难区分。 我会准备不同的数据集,对大多数类进行下采样,并使用所有少数类的示例,然后在所有数据集上学习svm。然后使用投票。这对我很有用

model = svmtrain(trainLabels, trainFeatures, '-h 0 -b 1 -s 0 -c 10 -w1 0.5 -w-1 0.003');
[predicted_label, accuracy, prob_estimates] = svmpredict(testLabels, testFeatures, model, '-b 1');