gaterSVM: Mixture SVMs with gater function

View source: R/gaterSVM.R

gaterSVMR Documentation

Mixture SVMs with gater function

Description

Implementation of Collobert, R., Bengio, S., and Bengio, Y. "A parallel mixture of SVMs for very large scale problems. Neural computation".

Usage

gaterSVM(
  x,
  y,
  m,
  c = 1,
  max.iter,
  hidden = 5,
  learningrate = 0.01,
  threshold = 0.01,
  stepmax = 100,
  seed = NULL,
  valid.x = NULL,
  valid.y = NULL,
  valid.metric = NULL,
  verbose = FALSE,
  ...
)

Arguments

x

the nxp training data matrix. Could be a matrix or an object that can be transformed into a matrix object.

y

a response vector for prediction tasks with one value for each of the n rows of x. For classification, the values correspond to class labels and can be a 1xn matrix, a simple vector or a factor. For regression, the values correspond to the values to predict, and can be a 1xn matrix or a simple vector.

m

the number of experts

c

a positive constant controlling the upper bound of the number of samples in each subset.

max.iter

the number of iterations

hidden

the number of neurons on the hidden layer

learningrate

the learningrate for the back propagation

threshold

neural network stops training once all gradient is below the threshold

stepmax

the maximum iteration of the neural network training process

seed

the random seed. Set it to NULL to randomize the model.

valid.x

the mxp validation data matrix.

valid.y

if provided, it will be used to calculate the validation score with valid.metric

valid.metric

the metric function for the validation result. By default it is the accuracy for classification. Customized metric is acceptable.

verbose

a logical value indicating whether to print information of training.

...

other parameters passing to neuralnet

Value

  • expert a list of svm experts

  • gater the trained neural network model

  • valid.pred the validation prediction

  • valid.score the validation score

  • valid.metric the validation metric

  • time a list object recording the time consumption for each steps.

Examples


data(svmguide1)
svmguide1.t = as.matrix(svmguide1[[2]])
svmguide1 = as.matrix(svmguide1[[1]])
gaterSVM.model = gaterSVM(x = svmguide1[,-1], y = svmguide1[,1], hidden = 10, seed = 0,
                          m = 10, max.iter = 1, learningrate = 0.01, threshold = 1, stepmax = 100,
                          valid.x = svmguide1.t[,-1], valid.y = svmguide1.t[,1], verbose = FALSE)
table(gaterSVM.model$valid.pred,svmguide1.t[,1])
gaterSVM.model$valid.score


hetong007/SwarmSVM documentation built on Jan. 10, 2023, 12:52 a.m.