我可以对LIBSVM的svmtrain进行哪些修改以提高垃圾邮件分类器的准确性?

问题描述 投票:0回答:1

我正在使用Octave版本5.2.0和LIBSVM 3.24来构建垃圾邮件分类器。在不使用LIBSVM的情况下,我在测试和训练数据上的准确度均> 99%。但是在使用LIBSVM时,我的准确率只有68-69%。我应该对LIBSVM选件进行哪些修改?这是我使用的代码模型= svmtrain(X,y,'-c 0.1 -t 2 -s 0 -g 1000');p = svmpredict(y,X,model);

matlab machine-learning classification octave libsvm
1个回答
0
投票

您知道LibSVM的设置吗?

% libSVM options:
% -s svm_type: set type of SVM (default 0)
%   0 -- C-SVC
%   1 -- nu-SVC
%   2 -- one-class SVM
%   3 -- epsilon-SVR
%   4 -- nu-SVR
% -t kernel_type: set type of kernel function (default 2)
%   0 -- linear: u'*v
%   1 -- polynomial: (gamma*u'*v + coef0)^degree
%   2 -- radial basis function: exp(-gamma*|u-v|^2)
%   3 -- sigmoid: tanh(gamma*u'*v + coef0)
% -d degree: set degree in kernel function (default 3)
% -g gamma: set gamma in kernel function (default 1/num_features)
% -r coef0: set coef0 in kernel function (default 0)
% -c cost: set the parameter C of C-SVC, epsilon-SVR, and nu-SVR (default 1)
% -n nu: set the parameter nu of nu-SVC, one-class SVM, and nu-SVR (default 0.5)
% -p epsilon: set the epsilon in loss function of epsilon-SVR (default 0.1)
% -m cachesize: set cache memory size in MB (default 100)
% -e epsilon: set tolerance of termination criterion (default 0.001)
% -h shrinking: whether to use the shrinking heuristics, 0 or 1 (default 1)
% -b probability_estimates: whether to train a SVC or SVR model for probability estimates, 0 or 1 (default 0)
% -wi weight: set the parameter C of class i to weight*C, for C-SVC (default 1)

因此,您的-s 0 -t 2 -g 1000 -c 0.1设置将转换为具有高斯内核(-s 0)的C-SVM(-t 2),该内核具有较大的缩放比例(-g 1000)并且小于违规的默认成本(-c 0.1) 。

我建议先使用默认值(-s 0 -t 2)进行尝试,然后增加成本-c。您的伽玛值看起来非常可笑,但是在不知道您的数据的情况下,没人能判断出这一点。看一下[[超参数优化]],它可以精确设置这些值。有很多工作要做,但是我只对回归分析很熟悉。如有疑问,请通过gridsearchga对这些参数进行全局优化。

© www.soinside.com 2019 - 2024. All rights reserved.