【问题标题】:What is the model file in svm-train command-line syntax?svm-train 命令行语法中的模型文件是什么?
【发布时间】:2013-11-17 05:41:13
【问题描述】:

我在 LIBSVM 中使用了 grid.py,并为我的数据集找到了最佳参数

C -8.0 g -0.0625 CV- 63.82

然后我尝试了 svm-train 但我不明白 svm-train 命令的语法

svm-train [options] training_set_file [model_file] 

需要一个 model_File 但 grid.py 只给了我一个 .out 文件。当我使用它时,它显示错误。

我的问题是: 你能解释一下模型文件是什么,最好用一个例子吗?

我在 Debian 上使用 LIBSVM(使用命令行)。

【问题讨论】:

    标签: libsvm


    【解决方案1】:

    你想要这样的命令行:

    svm-train -C 8.0 -g 0.0625 training.data svm.model
    svm-predict testing.data  svm.model   predict.out 
    

    模型文件(svm.model)只是存储svm-train学习的模型参数的地方,以便以后可以用于预测。该模型由 svm-train 创建,它不是由 grid.py 生成的,它是 svm-predict 的输入。因此,你可以为 svm--train 取任何你喜欢的名字,只要你给 svm-predict 取相同的名字。我经常把这个文件称为model-C8.0-g0.0625 这样我以后可以知道它是什么。

    模型文件如下所示:

    svm_type c_svc
    kernel_type rbf
    gamma 0.5
    nr_class 2
    total_sv 6164
    rho -2.4768
    label 1 -1
    nr_sv 3098 3066
    SV
    2 1:-0.452773 2:-0.455573 3:-0.485312 4:-0.436805 ...
    

    如果您需要了解更多关于模型文件的信息,请参阅the LIBSVM FAQ

    【讨论】:

      猜你喜欢
      • 2015-05-02
      • 1970-01-01
      • 2015-08-30
      • 2021-05-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-11
      相关资源
      最近更新 更多