svor_exc {mildsvm} | R Documentation |
Fit SVOR-EXC model to ordinal outcome data
Description
This function fits the Support Vector Ordinal Regression with Explicit Constraints based on the research of Chu and Keerthi (2007).
Usage
## Default S3 method:
svor_exc(
x,
y,
cost = 1,
method = c("smo"),
weights = NULL,
control = list(kernel = "linear", sigma = if (is.vector(x)) 1 else 1/ncol(x),
max_step = 500, scale = TRUE, verbose = FALSE),
...
)
## S3 method for class 'formula'
svor_exc(formula, data, ...)
## S3 method for class 'mi_df'
svor_exc(x, ...)
Arguments
x |
A data.frame, matrix, or similar object of covariates, where each
row represents an instance. If a |
y |
A numeric, character, or factor vector of bag labels for each
instance. Must satisfy |
cost |
The cost parameter in SVM. |
method |
The algorithm to use in fitting (default |
weights |
|
control |
list of additional parameters passed to the method that control computation with the following components:
|
... |
Arguments passed to or from other methods. |
formula |
A formula with specification |
data |
If |
Value
An object of class svor_exc
The object contains at least the
following components:
-
smo_fit
: A fit object from running the modified ordinal smo algorithm. -
call_type
: A character indicating which methodsvor_exc()
was called with. -
features
: The names of features used in training. -
levels
: The levels ofy
that are recorded for future prediction. -
cost
: The cost parameter from function inputs. -
n_step
: The total steps used in the heuristic algorithm. -
x_scale
: Ifscale = TRUE
, the scaling parameters for new predictions.
Methods (by class)
-
default
: Method for data.frame-like objects -
formula
: Method for passing formula -
mi_df
: Method formi_df
objects, automatically handling bag names, labels, and all covariates. Use thebag_label
asy
at the instance level, then performsvor_exc()
ignoring the MIL structure and bags.
Author(s)
Sean Kent
References
Chu, W., & Keerthi, S. S. (2007). Support vector ordinal regression. Neural computation, 19(3), 792-815. doi: 10.1162/neco.2007.19.3.792
See Also
predict.svor_exc()
for prediction on new data.
Examples
data("ordmvnorm")
x <- ordmvnorm[, 3:7]
y <- attr(ordmvnorm, "instance_label")
mdl1 <- svor_exc(x, y)
predict(mdl1, x)