KevinCoble / AIToolbox

A toolbox of AI modules written in Swift: Graphs/Trees, Support Vector Machines, Neural Networks, PCA, K-Means, Genetic Algorithms
Apache License 2.0
793 stars 87 forks source link

SVM Training for one-class-svm doesn't work #20

Open borozanov opened 6 years ago

borozanov commented 6 years ago

When creating a One-Class SVM classifier (e.g. for the following data) do { try trainData.addDataPoint(input: [0.2, 0.9], dataClass:1) try trainData.addDataPoint(input: [0.8, 0.3], dataClass:1) try trainData.addDataPoint(input: [0.5, 0.6], dataClass:1) } //catch etc. let svm = SVMModel(problemType: .oneClassSVM, kernelSettings: KernelParameters(type: .radialBasisFunction, degree: 0, gamma: 0.5, coef0: 0.0)) svm.train(trainData)

Throws Index out of range error in SVM.swift in two places: Line 1531 and Line 1197

ksmsoftware commented 6 years ago

Have you figured out a solution and if you have would you mind sharing it?

borozanov commented 6 years ago

Unfortunately, no solution 👎