Using the LibSVM MATLAB interface, I trained an SVM model with specified gamma, cost, and epsilon parameters via:
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:
load('SVRModel1');
I see some of the model parameters but not the C and epsilon values I specified:
>> 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. You may just save them separately besides save model
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.