[英]Reading the gamma, cost, and epsilon parameters of SVM model?
Using the LibSVM MATLAB interface, I trained an SVM model with specified gamma, cost, and epsilon parameters via: 使用LibSVM MATLAB界面,我通过以下方法训练了具有指定伽玛,成本和epsilon参数的SVM模型:
model = svmtrain(trDatY,trDatX,'-s 3 -t 2 -c 1 -g 0.0004 -p 0.003 -h 0');
and saved it to a file via: 并通过以下方式将其保存到文件中:
save('SVRModel1','y_hat','tsDatY','model');
When I read the model file back into MATLAB using: 当我使用以下命令将模型文件读回到MATLAB中时:
load('SVRModel1');
I see some of the model parameters but not the C and epsilon values I specified: 我看到一些模型参数,但看不到我指定的C和epsilon值:
>> model
model =
Parameters: [5x1 double]
nr_class: 2
totalSV: 8612
rho: -90.5478
Label: []
ProbA: []
ProbB: []
nSV: []
sv_coef: [8612x1 double]
SVs: [8612x258 double]
>> model.Parameters
ans =
3.0000
2.0000
3.0000
0.0004
0
Can someone please tell me how to save/read the model so that I can read and retrieve all the parameters I set to train the model? 有人可以告诉我如何保存/读取模型,以便读取和检索为训练模型设置的所有参数吗?
Thank you! 谢谢!
The model.Parameters
includes the value of '-s -t -d -g -r'
respectively, and the cost function coefficient ( C
) and epsilon
is not included. 该
model.Parameters
的参数model.Parameters
包括'-s -t -d -g -r'
的值,并且不包括成本函数系数( C
)和epsilon
。 You may just save them separately besides save model
除了
save model
您可以单独保存它们
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.