machinelearning

SVM

fields

SVM = {
c : number ,
coef0 : number ,
degree : number ,
gamma : number ,
nu : number ,
p : number ,
kernelType : uint ,
classWeights : Mat ,
varCount : uint ,
isTrained : boolean
}

constructors

constructor ( c : number = 0 , coef0 : number = 0 , degree : number = 0 , gamma : number = 0 , nu : number = 0 , p : number = 0 , kernelType : uint = 0 , classWeights : Mat = Mat() )

functions

calcError

Result = {
error : number ,
responses : Mat
}
calcError ( trainData : TrainData , test : boolean ) : Result

getSupportVectors

Result : Mat
getSupportVectors () : Result

load

load ( file : string ) : Result

predict

Result : uint
predict ( sample : number [] , flags : uint = 0 ) : Result
Result : uint []
predict ( samples : Mat , flags : uint = 0 ) : Result

save

save ( file : string ) : Result

setParams

setParams ( c : number = this.c , coef0 : number = this.coef0 , degree : number = this.degree , gamma : number = this.gamma , nu : number = this.nu , p : number = this.p , kernelType : uint = this.kernelType , classWeights : Mat = this.classWeights ) : Result

train

Result : boolean
train ( trainData : TrainData , flags : uint = 0 ) : Result
trainAsync ( trainData : TrainData , flags : uint = 0 ) : Promise < Result >
trainAsync ( trainData : TrainData , flags : uint = 0 , ...opts , callback ( err : Error , Result res )) : void
Result : boolean
train ( samples : Mat , layout : uint , responses : Mat ) : Result
trainAsync ( samples : Mat , layout : uint , responses : Mat ) : Promise < Result >
trainAsync ( samples : Mat , layout : uint , responses : Mat , callback ( err : Error , Result res )) : void

trainAuto

Result : Mat
trainAuto ( trainData : TrainData , kFold : uint = 10 , cGrid : ParamGrid = ParamGrid(ml.SVM.C) , gammaGrid : ParamGrid = ParamGrid(ml.SVM.GAMMA) , pGrid : ParamGrid = ParamGrid(ml.SVM.P) , nuGrid : ParamGrid = ParamGrid(ml.SVM.NU) , coeffGrid : ParamGrid = ParamGrid(ml.SVM.COEF) , degreeGrid : ParamGrid = ParamGrid(ml.SVM.DEGREE) , balanced : boolean = false ) : Result
trainAutoAsync ( trainData : TrainData , kFold : uint = 10 , cGrid : ParamGrid = ParamGrid(ml.SVM.C) , gammaGrid : ParamGrid = ParamGrid(ml.SVM.GAMMA) , pGrid : ParamGrid = ParamGrid(ml.SVM.P) , nuGrid : ParamGrid = ParamGrid(ml.SVM.NU) , coeffGrid : ParamGrid = ParamGrid(ml.SVM.COEF) , degreeGrid : ParamGrid = ParamGrid(ml.SVM.DEGREE) , balanced : boolean = false ) : Promise < Result >
trainAutoAsync ( trainData : TrainData , kFold : uint = 10 , cGrid : ParamGrid = ParamGrid(ml.SVM.C) , gammaGrid : ParamGrid = ParamGrid(ml.SVM.GAMMA) , pGrid : ParamGrid = ParamGrid(ml.SVM.P) , nuGrid : ParamGrid = ParamGrid(ml.SVM.NU) , coeffGrid : ParamGrid = ParamGrid(ml.SVM.COEF) , degreeGrid : ParamGrid = ParamGrid(ml.SVM.DEGREE) , balanced : boolean = false , ...opts , callback ( err : Error , Result res )) : void