write_cmd.m

来自「libsvm is a simple, easy-to-use, and eff」· M 代码 · 共 21 行

M
21
字号
function write_cmd(value_lambda, value_gamma, fname_train, fname_model)



%    This function is to write  "parameters", "training file name" and "output-model file name" 
%    into a " .m" Matlab file (namely, "svm_cmd.m", defined below ), which will run SVM machine.




value_t=2;  %%%%% value_t=2  means we take RBF  kernel

fid=fopen('svm_cmd.m','wt');

string=[fname_train,' ',fname_model];

fprintf(fid,['!svmtrain -t %i -c %g -g %g ', string], [value_t, value_lambda, value_gamma]);

fclose(fid);

fclose all;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?