【问题标题】:How to get training accuracy in svmlight with cross validation如何通过交叉验证在 svmlight 中获得训练准确性
【发布时间】:2014-05-02 08:17:51
【问题描述】:

我想使用 SVMlight 在我的训练集上运行交叉验证。似乎这个选项是 -x 1 (虽然我不确定它实现了多少折叠......)。输出是:

XiAlpha-estimate of the error: error<=31.76% (rho=1.00,depth=0)
XiAlpha-estimate of the recall: recall=>68.24% (rho=1.00,depth=0)
XiAlpha-estimate of the precision: precision=>69.02% (rho=1.00,depth=0)
Number of kernel evaluations: 56733
Computing leave-one-out **lots of gibberish here**
Retrain on full problem..............done.
Leave-one-out estimate of the error: error=12.46%
Leave-one-out estimate of the recall: recall=86.39%
Leave-one-out estimate of the precision: precision=88.82%
Actual leave-one-outs computed:  412 (rho=1.00)
Runtime for leave-one-out in cpu-seconds: 0.84

如何获得准确性?来自estimate of the error?

谢谢!

【问题讨论】:

    标签: machine-learning svm cross-validation svmlight


    【解决方案1】:

    这些是相互矛盾的概念。训练误差是训练集上的误差,而交叉验证用于近似验证误差(在未用于训练的数据上) .

    您的输出表明您正在使用 N 折(其中 N 大小的训练集),这会导致所谓的“留一个”验证(只有 1 个测试点!),这会高估模型的质量。你应该尝试10倍,你的准确率只是1-error。

    【讨论】:

    • 谢谢@lejlot,但恐怕我听不懂你。 1.交叉验证不用于训练数据? (this 不正确吗?) 2. 我不明白你答案的第二部分 - 我没有看到我如何决定使用多少折叠,为什么它高估了模型的质量,什么是 1 -错误......我真的很抱歉......如果你能解释更多,我真的很感激。非常感谢!
    • 训练数据顾名思义就是用于训练的数据。虽然交叉验证将您的数据分为训练和测试,但在训练阶段从未见过前者。你写了“训练准确性”——这是错误的,而不是关于将数据用于 CV 的句子。训练准确度不由 CV 衡量。 “1-error”的意思是“从 1 中减去错误值,你就得到了准确性”。最后 - 留下一个“高估”,因为它返回的准确度比它应该的要高得多。 “合理”的折叠数是 10(通常在这种情况下使用)。
    • 啊...现在我让你变得更好@lejlot,谢谢,但是 - 恕我直言,我认为交叉验证在 training 阶段用于测试目的,不是是吗?至于你所说的使用 10 折 - 我同意,但留一估计是(我认为)svmlight 允许的唯一交叉验证形式。
    • 您仍然在混淆术语。 “训练误差”不是“训练阶段计算的误差”,而是“训练集上的误差”。这与 validation 集上基于 cv 的误差估计完全不同。
    • 抱歉,如果我错过了它,但是您如何使用 svmlight 指定训练集中留一法交叉验证的折叠数? -x 可以是0也可以是1,那还有其他参数吗?
    猜你喜欢
    • 2023-03-24
    • 2021-12-10
    • 1970-01-01
    • 2020-07-07
    • 2022-07-22
    • 2016-07-20
    • 2021-10-30
    • 2020-10-12
    • 2015-04-21
    相关资源
    最近更新 更多