You are here: Start » AVL.NET » AVL.SVM_Train(AvlNet.SvmModel, float[][], int[], AvlNet.SvmModel, float)

AVL.SVM_Train(AvlNet.SvmModel, float[][], int[], AvlNet.SvmModel, float)

Trains SVM model

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax


public static void SVM_Train(
	AvlNet.SvmModel inSvmModel,
	float[][] inVectorArray,
	int[] inAnswerArray,
	out AvlNet.SvmModel outTrainedSvmModel,
	out float outTrainingAccuracy
)

Parameters

inSvmModel
Type: AvlNet.SvmModel
Initialized SVM model
inVectorArray
Type: System.Single
Training data vector array
inAnswerArray
Type: System.Int32
Correct classes for data vectors
outTrainedSvmModel
Type: AvlNet.SvmModel
Trained model
outTrainingAccuracy
Type: System.Single
Accuracy of prediction on training set

Description

The operation trains an SVM classifier initialized beforehand by SVM_Init function. It takes two arrays as arguments:

  • inVectorArray, an array of data points with known classes
  • inAnswerArray, an array of classes where the corresponding data points belong

Those two arrays have to be of the same size. Moreover, there have to be at least two classes within the training data set.

The output outTrainedSvmModel is an SVM_Model that may be used by SVM_Classify function.

outTrainingAccuracy is the fraction of correctly classified training data points.

Errors

Error type Description
DomainError Incompatible array sizes in SVM Train
DomainError Incorrect or uninitialized SvmModel in Svm_Train.
DomainError Cannot re-train SvmModel.
DomainError Data vector cannot be empty in SVM_Train
DomainError Incompatible vector sizes in SVM_Train

See also