MulticlassSupportVectorMachine with Gaussian<DynamicTimeWarping> Kernel not supported?

33 views
Skip to first unread message

Surya Kiran

unread,
May 17, 2017, 4:38:12 AM5/17/17
to Accord.NET Framework
Cesar thank you for a brilliantly made library to make life easier. 

I am trying to classify sequences with multiple class labels and thousands of sequences. Previously, i used only DynamicTimeWarping kernel with MultiClassSVM but it yields very poor results. I came across your solution here which states i can use Gaussian kernel to improve the results. Since i need classlabels as output i am not able to use KernelSupportVectorMachine and moreover it is obsolete now. I tried to implement Gaussian<DynamicTimeWarping> with MulticlassSVM but it gives me error. 

So far i tried like this:

            var gkernel = new DynamicTimeWarping(length: 16);
            var kernel = new Gaussian<DynamicTimeWarping>(gkernel);

            svm = new MulticlassSupportVectorMachine<Gaussian,double[][]>(0, kernel, 2); //here is the error

            //svm = new KernelSupportVectorMachine(kernel, inputs: 0);

           // var smo = new SequentialMinimalOptimization<DynamicTimeWarping,double[][]>();
            //Create the Sequential Minimal Optimization learning algorithm
            var smo = new MulticlassSupportVectorLearning<DynamicTimeWarping, double[][]>()
            {
                Learner = (param) => new SequentialMinimalOptimization<DynamicTimeWarping,double[][]>()
                {
                    Kernel = new DynamicTimeWarping(16),
                    //UseKernelEstimation = true
                }
            };

           

            //smo.ParallelOptions.MaxDegreeOfParallelism = 1;
            // And use it to learn a machine!
            smo.Learn(trainArray, labelArray);

I would appreciate some help to solve this issue. Thanks!
Reply all
Reply to author
Forward
0 new messages