predict.svmmaj: Out-of-Sample Prediction from Unseen Data.

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/predict.R

Description

This function predicts the predicted value (including intercept), given a previous trained model which has been returned by svmmaj.

Usage

1
2
3
## S3 method for class 'svmmaj'
predict(object, X.new, y = NULL, weights = NULL,
  show.plot = FALSE, ...)

Arguments

object

Model which has been trained beforehand using svmmaj.

X.new

Attribute matrix of the objects to be predicted, which has the same number of attributes as the untransformed attribute matrix in model.

y

The actual class labels (only if show.plot==TRUE).

weights

The weight of observation as the relative importance of the prediction error of the observation.

show.plot

If show.plot=TRUE, it plots the density of the predicted value for both class labels, if y is not specified, the density of all objects will be plotted.

...

Arguments to be passed to methods.

Value

The predicted value (including intercept) of class q.svmmaj, with attributes:

y

The observed class labels of each object.

yhat

he predicted class labels of each object.

classes

The class labels.

Author(s)

Hok San Yip, Patrick J.F. Groenen, Georgi Nalbantov

References

P.J.F. Groenen, G. Nalbantov and J.C. Bioch (2008) SVM-Maj: a majorization approach to linear support vector machines with different hinge errors.

See Also

svmmaj

Examples

1
2
3
4
5
6
7
attach(AusCredit)

## model training
model <- svmmaj(X[1:400, ], y[1:400], hinge = 'quadratic', lambda = 1)
## model prediction
q4     <- predict(model, X[-(1:400), ], y[-(1:400)], show.plot = TRUE)
q4

SVMMaj documentation built on May 2, 2019, 9:58 a.m.