Hyperplane in SVM classifier

后端 未结 1 1490
梦毁少年i
梦毁少年i 2021-01-23 15:23

I want to get a formula for hyperplane in SVM classifier,

so I can calculate the probability of true classification for each sample according to distance from hyperplane

相关标签:
1条回答
  • 2021-01-23 15:55

    SVM-based classifier contains Support Vectors

    to read it from svmStruct a bit more easily, use svmtrain call with "AUTOSCALE", false:

    svmStruct.SupportVectors
    
    svmStruct = 
    
              SupportVectors: [3x2 double]
                       Alpha: [3x1 double]
                        Bias: -23.1428
              KernelFunction: @linear_kernel
          KernelFunctionArgs: {}
                  GroupNames: [150x1 logical]
        SupportVectorIndices: [3x1 double]
                   ScaleData: []
               FigureHandles: {[170.0012] [171.0052 172.0018] [225.0018]}
    
    
    ans =
    
        5.5000 3.5000
        4.5000 2.3000
        4.9000 2.5000
    

    or

    >> data( svmStruct.SupportVectorIndices,: )
    
    ans =
    
        5.5000 3.5000
        4.5000 2.3000
        4.9000 2.5000
    

    If you use the default 'autoscale' option, then you will need to unwind the scaling using something rather ugly like this:

     (    data( svmStruct.SupportVectorIndices( 1 ),: )
        + svmStruct.ScaleData.shift
      ).* svmStruct.ScaleData.scaleFactor
    

    ( >>> https://www.mathworks.com/matlabcentral/newsreader/view_thread/249055 )


    For construction of a separating Hyperplane from SVM-classifier internal data, you may be interested in >>> http://scikit-learn.org/stable/auto_examples/svm/plot_separating_hyperplane.html

    enter image description here Parameters for to plot the maximum margin separating hyperplane within a two-class separable dataset using a Support Vector Machines classifier with linear kernel

    0 讨论(0)
提交回复
热议问题