运行 带子进程的 libsvm 不创建模型

Running libsvm with subprocess don't create a model

我正在尝试使用 svm-train 生成 20 个模型。此脚本工作并打印交叉验证值,但未创建模型文件。我不知道为什么,任何想法?

for i in range(1,21):
    format_libsvm(data,"test",i) # create a data file called test 
    data = "test"
    model = "model"+str(i)
    batcmd = "./libsvm-3.21/svm-train -b 1 -v 10 "+data+".scale "+model
    subprocess.call(batcmd, shell=True)
    regex_CV = 'Cross Validation Accuracy = ([0-9\.]+)%' 
    result_re = re.search(regex_CV,result)
    print (num2aa[i]+" "+result_re.group(1))

非常感谢您提供的任何帮助。

"Cross validation is used for selecting good parameters. After finding them, you want to re-train the whole data without the -v option." csie.ntu.edu.tw/~cjlin/libsvm/faq.html#f501

这就是我没有模型文件的原因。我的错。