predict.wsvm: Predict New Examples by a Trained (Weighted) Support Vector...

Description Usage Arguments Value Note See Also

Description

This function predicts values based upon a model trained by wsvm.

Usage

1
2
predict.wsvm(object, newdata, decision.values = FALSE, probability = FALSE,
  ..., na.action = na.omit)

Arguments

object

Object of class "wsvm", created by wsvm.

newdata

An object containing the new input data: either a matrix or a sparse matrix (object of class Matrix provided by the Matrix package, or of class matrix.csr provided by the SparseM package, or of class simple_triplet_matrix provided by the slam package). A vector will be transformed to a n x 1 matrix. @param decision.values Logical controlling whether the decision values of all binary classifiers computed in multiclass classification shall be computed and returned. @param probability Logical indicating whether class probabilities should be computed and returned. Only possible if the model was fitted with the probability option enabled. @param na.action A function to specify the action to be taken if ‘NA’s are found. The default action is na.omit, which leads to rejection of cases with missing values on any required variable. An alternative is na.fail, which causes an error if NA cases are found. (NOTE: If given, this argument must be named.)

...

Currently not used.

Value

A vector of predicted values (for classification: a vector of labels, for density estimation: a logical vector). If decision.value is TRUE, the vector gets a "decision.values" attribute containing a n * c matrix (n number of predicted values, c number of classifiers) of all c binary classifiers' decision values. There are k * (k - 1) / 2 classifiers (k number of classes). The colnames of the matrix indicate the labels of the two classes. If probability is TRUE, the vector gets a "probabilities" attribute containing a n * k matrix of the class probabilities.

Note

If the training set was scaled by wsvm (done by default), the new data is scaled accordingly using scale and center of the training data.

See Also

wsvm, predict.svm, svm.

Other svm: wsvm


schiffner/locClass documentation built on May 29, 2019, 3:39 p.m.