train data must be the data without labels. Labels should be provided in trainLabels

svmofit(train, trainLabels, weights, cost, gamma)

Arguments

train

Training data of numeric type without labels.

trainLabels

A vector of numeric tags for each instance of training data.

weights

A boolean indicating whether weights per instance are used.

cost

numeric value indicating the cost parameter to train the SVM.

gamma

numeric value indicating the gamma parameter to train the SVM.

Value

A matrix of 1xn svm trained with weights models.

Examples

dattrain<-read.table("train_balance-scale.0", sep=" ")
#> Warning: cannot open file 'train_balance-scale.0': No such file or directory
#> Error in file(file, "rt"): cannot open the connection
modelstrain<-svmofit(dattrain[,-ncol(dattrain)],dattrain[,ncol(dattrain)],TRUE,1,1)
#> Error in svmofit(dattrain[, -ncol(dattrain)], dattrain[, ncol(dattrain)], TRUE, 1, 1): object 'dattrain' not found