Skip to content
This repository was archived by the owner on Nov 19, 2020. It is now read-only.
This repository was archived by the owner on Nov 19, 2020. It is now read-only.

SVM code that worked with version 2.11.0.0, fails to converge with 2.14.0 #61

@mathias-brandewinder

Description

@mathias-brandewinder

I had an F# sample for multiclass SVM that work perfectly with version 2.11.0.0, but when I run the same code upgrading to version 2.14.0, SVM fails to converge.

The sample code I am using is here (relevant code part highlighted) - it's a multi-class SVM model on a subset of the MINST/digit recognition dataset:
https://github.com/mathias-brandewinder/Presentations/blob/master/Machine-Learning-With-FSharp/code/Classification/Script.fsx#L49-67

When I upgraded to 2.14.0, I get the error message below. Was there any significant change to the library that would explain this?

Thanks in advance!

Mathias

System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> Accord.ConvergenceException: Convergence could not be attained. Please reduce the cost of misclassification errors by reducing the complexity parameter C or try a different kernel function.
at Accord.MachineLearning.VectorMachines.Learning.SequentialMinimalOptimization.Run(CancellationToken token, Double[] c)
at Accord.MachineLearning.VectorMachines.Learning.BaseSupportVectorLearning.Run(Boolean computeError, CancellationToken token)
at Accord.MachineLearning.VectorMachines.Learning.MulticlassSupportVectorLearning.<>c__DisplayClass4.<>c__DisplayClass6.b__1(Int32 j)
at System.Threading.Tasks.Parallel.<>c__DisplayClassf1.<ForWorker>b__c() at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask) at System.Threading.Tasks.Task.<>c__DisplayClass11.<ExecuteSelfReplicating>b__10(Object param0) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.Wait() at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Func4 bodyWithLocal, Func1 localInit, Action1 localFinally)
at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action1 body) at Accord.MachineLearning.VectorMachines.Learning.MulticlassSupportVectorLearning.<>c__DisplayClass4.<Run>b__0(Int32 i) at System.Threading.Tasks.Parallel.<>c__DisplayClassf1.b__c()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass11.b__10(Object param0)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Func4 bodyWithLocal, Func1 localInit, Action1 localFinally) at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action1 body)
at Accord.MachineLearning.VectorMachines.Learning.MulticlassSupportVectorLearning.Run(Boolean computeError, CancellationToken token)
at <StartupCode$FSI_0002>.$FSI_0002.main@() in c:\Users\Mathias Brandewinder\Documents\Visual Studio 2013\Projects\AccordDemo\AccordDemo\Script.fsx:line 59
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> Accord.ConvergenceException: Convergence could not be attained. Please reduce the cost of misclassification errors by reducing the complexity parameter C or try a different kernel function.
at Accord.MachineLearning.VectorMachines.Learning.SequentialMinimalOptimization.Run(CancellationToken token, Double[] c)
at Accord.MachineLearning.VectorMachines.Learning.BaseSupportVectorLearning.Run(Boolean computeError, CancellationToken token)
at Accord.MachineLearning.VectorMachines.Learning.MulticlassSupportVectorLearning.<>c__DisplayClass4.<>c__DisplayClass6.b__1(Int32 j)
at System.Threading.Tasks.Parallel.<>c__DisplayClassf1.<ForWorker>b__c() at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask) at System.Threading.Tasks.Task.<>c__DisplayClass11.<ExecuteSelfReplicating>b__10(Object param0) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.Wait() at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Func4 bodyWithLocal, Func1 localInit, Action1 localFinally)
at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action1 body) at Accord.MachineLearning.VectorMachines.Learning.MulticlassSupportVectorLearning.<>c__DisplayClass4.<Run>b__0(Int32 i) at System.Threading.Tasks.Parallel.<>c__DisplayClassf1.b__c()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass11.b__10(Object param0)
---> (Inner Exception #0) Accord.ConvergenceException: Convergence could not be attained. Please reduce the cost of misclassification errors by reducing the complexity parameter C or try a different kernel function.
at Accord.MachineLearning.VectorMachines.Learning.SequentialMinimalOptimization.Run(CancellationToken token, Double[] c)
at Accord.MachineLearning.VectorMachines.Learning.BaseSupportVectorLearning.Run(Boolean computeError, CancellationToken token)
at Accord.MachineLearning.VectorMachines.Learning.MulticlassSupportVectorLearning.<>c__DisplayClass4.<>c__DisplayClass6.b__1(Int32 j)
at System.Threading.Tasks.Parallel.<>c__DisplayClassf`1.b__c()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass11.b__10(Object param0)<---
<---

---> (Inner Exception #1) System.AggregateException: One or more errors occurred. ---> Accord.ConvergenceException: Convergence could not be attained. Please reduce the cost of misclassification errors by reducing the complexity parameter C or try a different kernel function.
at Accord.MachineLearning.VectorMachines.Learning.SequentialMinimalOptimization.Run(CancellationToken token, Double[] c)
at Accord.MachineLearning.VectorMachines.Learning.BaseSupportVectorLearning.Run(Boolean computeError, CancellationToken token)
at Accord.MachineLearning.VectorMachines.Learning.MulticlassSupportVectorLearning.<>c__DisplayClass4.<>c__DisplayClass6.b__1(Int32 j)
at System.Threading.Tasks.Parallel.<>c__DisplayClassf1.<ForWorker>b__c() at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask) at System.Threading.Tasks.Task.<>c__DisplayClass11.<ExecuteSelfReplicating>b__10(Object param0) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.Wait() at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Func4 bodyWithLocal, Func1 localInit, Action1 localFinally)
at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action1 body) at Accord.MachineLearning.VectorMachines.Learning.MulticlassSupportVectorLearning.<>c__DisplayClass4.<Run>b__0(Int32 i) at System.Threading.Tasks.Parallel.<>c__DisplayClassf1.b__c()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass11.b__10(Object param0)
---> (Inner Exception #0) Accord.ConvergenceException: Convergence could not be attained. Please reduce the cost of misclassification errors by reducing the complexity parameter C or try a different kernel function.
at Accord.MachineLearning.VectorMachines.Learning.SequentialMinimalOptimization.Run(CancellationToken token, Double[] c)
at Accord.MachineLearning.VectorMachines.Learning.BaseSupportVectorLearning.Run(Boolean computeError, CancellationToken token)
at Accord.MachineLearning.VectorMachines.Learning.MulticlassSupportVectorLearning.<>c__DisplayClass4.<>c__DisplayClass6.b__1(Int32 j)
at System.Threading.Tasks.Parallel.<>c__DisplayClassf`1.b__c()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass11.b__10(Object param0)<---
<---

Stopped due to error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions