% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wrap_svm.R
\name{wrap_svm}
\alias{wrap_svm}
\alias{predict.wrap_svm}
\alias{print.wrap_svm}
\title{S3 wrapper for e1071 SVM}
\usage{
wrap_svm(x, y, ...)

\method{predict}{wrap_svm}(object, newx, type = c("class", "prob"), ...)

\method{print}{wrap_svm}(x, ...)
}
\arguments{
\item{x}{A matrix or data.frame of features.}

\item{y}{A factor or character vector for classification, numeric for regression.}

\item{...}{Additional arguments passed to [e1071::svm()].
`probability = TRUE` is set automatically for classification; do not
override this if you need `type = "prob"` predictions.}

\item{object}{A fitted `wrap_svm` object.}

\item{newx}{A matrix or data.frame of new observations.}

\item{type}{`"class"` (default) for class labels, `"prob"` for a probability
matrix. Ignored for regression.}
}
\value{
An object of class `wrap_svm` with fields:
  \item{fit}{The fitted svm model.}
  \item{levels}{Class levels (NULL for regression).}
  \item{task}{"classification" or "regression".}
}
\description{
Fits an `e1071` support vector machine with a consistent
interface. Supports classification and regression.
}
\examples{

X <- as.matrix(iris[, 1:4])
y <- iris$Species
mod <- wrap_svm(X, y, kernel = "radial")
predict(mod, newx = X, type = "class")
predict(mod, newx = X, type = "prob")


X <- as.matrix(iris[, 1:4])
y <- iris$Species
mod <- wrap_svm(X, y, kernel = "radial")
predict(mod, newx = X, type = "class")
predict(mod, newx = X, type = "prob")

}
