【问题标题】:Can't predict output in SVM in MatLab无法在 MatLab 中预测 SVM 中的输出
【发布时间】:2016-07-28 11:57:48
【问题描述】:

我必须在 MatLab 中为课堂上的 svm 做自己的预测。我使用下一个公式:

    for i = 1:length(svmStruct1.Alpha)
        salidasvm1 = salidasvm1 + svmStruct1.Alpha(i,:)*svmStruct1.GroupNames(svmStruct1.SupportVectorIndices(i),:)*svmStruct1.KernelFunction(svmStruct1.SupportVectors(i,:),ent,cell2mat(svmStruct1.KernelFunctionArgs(1)));
    end

    salidas1 = max(salidasvm1 + svmStruct1.Bias);

问题是:

svmStruct1.KernelFunction(svmStruct1.SupportVectors(i,:),ent,cell2mat(svmStruct1.KernelFunctionArgs(1)))

预测总是返回 0。

感谢您的帮助。

【问题讨论】:

  • 您是否认为实际的训练过程没有为您生成正确的模型?
  • 我觉得是对的,因为predict函数效果很好

标签: matlab svm


【解决方案1】:

MatLab 更改了 SVM 的指令,因为最后的 MatLab 版本倾向于如此早地舍入并且 SVM 预测始终为 0。

【讨论】:

    猜你喜欢
    • 2021-12-28
    • 2013-04-30
    • 2016-04-07
    • 2018-11-29
    • 2018-11-01
    • 2019-10-13
    • 2015-01-07
    • 2019-07-06
    • 1970-01-01
    相关资源
    最近更新 更多