【问题标题】:svmtrain in matlab - the constraints are not restrictive enough.matlab 中的 svmtrain - 约束不够严格。
【发布时间】:2012-12-15 20:39:43
【问题描述】:

我在 matlab 中使用带有 MLP 内核 的 svmtrain,如下所示:

mlp=svmtrain(train_data,train_label,'Kernel_Function','mlp','showplot',true);

但我收到此错误:

??? Error using ==> svmtrain at 470
Unable to solve the optimization problem:
Exiting: the solution is unbounded and at infinity;
the constraints are not restrictive enough.

是什么原因?我尝试了其他内核,没有任何错误。 甚至我尝试了svmtrain - unable to solve the optimization problem的答案如下:

options = optimset('maxiter',1000);
svmtrain(train_data,train_label,'Kernel_Function','mlp','Method','QP',...
'quadprog_opts',options);

但我又遇到了同样的错误。 我的训练集是一个简单的 2 类数据点的 45*2 数据集。

【问题讨论】:

    标签: matlab kernel svm


    【解决方案1】:

    here 中的解决方案并没有真正解释任何事情。问题是二次规划方法无法收敛于优化问题。正常的做法是增加迭代次数,但我在相同大小的数据上进行了测试,迭代次数为 1,000,000 次,但仍然无法收敛。

    options = optimset('maxIter',1000000);
    
    mlp = svmtrain(data,labels,'Kernel_Function','mlp','Method','QP',...
    'quadprog_opts',options); 
    
    ??? Error using ==> svmtrain at 576
    Unable to solve the optimization problem:
    Exiting: the solution is unbounded and at infinity;
     the constraints are not restrictive enough.
    

    我的问题是:您是否有任何理由使用二次规划而不是 SMO 进行优化?使用 SMO 做同样的事情效果很好:

    mlp = svmtrain(data,labels,'Kernel_Function','mlp','Method','SMO');
    
    mlp = 
    
              SupportVectors: [40x2 double]
                       Alpha: [40x1 double]
                        Bias: 0.0404
              KernelFunction: @mlp_kernel
          KernelFunctionArgs: {}
                  GroupNames: [45x1 double]
        SupportVectorIndices: [40x1 double]
                   ScaleData: [1x1 struct]
               FigureHandles: []
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-28
      • 2015-08-27
      • 2013-04-06
      • 1970-01-01
      • 2013-09-13
      • 1970-01-01
      相关资源
      最近更新 更多