R/m09-SVN.R

Defines functions predictSVM learnSVM

Documented in learnSVM predictSVM

# Copyright (C) Kevin R. Coombes, 2007-2013

# Support Vector Machines

learnSVM <- function(data, status, params, pfun) {
  tdata <- data.frame(Stat=status, t(data))
  arglist <- c(list(formula = Stat ~ ., data=tdata),  params)
  model <- do.call(svm, arglist)
  FittedModel(pfun, data, status,
              details=list(model=model))
}

predictSVM <- function(newdata, details, status, ...) {
  predict(details$model, t(newdata), ...)
}

modelerSVM <- Modeler(learnSVM, predictSVM)

Try the Modeler package in your browser

Any scripts or data that you put into this service are public.

Modeler documentation built on Jan. 9, 2025, 3:01 a.m.