Learn R Programming

TunePareto (version 2.5.3)

predict.TuneParetoModel: Prediction method for TuneParetoClassifier objects

Description

S3 method that predicts the labels of unknown samples using a trained TunePareteModel model of a TuneParetoClassifier object.

Usage

# S3 method for TuneParetoModel
predict(object, newdata, ...)

Value

Returns a vector of class labels for the samples in newdata-

Arguments

object

A TuneParetoTraining object as returned by trainTuneParetoClassifier.

newdata

The samples whose class labels are predicted. This is usually a matrix or data frame with the samples in the rows and the features in the columns.

...

Further parameters for the predictor. These must be defined in the predictorParamNames argument of tuneParetoClassifier.

See Also

tuneParetoClassifier, predefinedClassifiers, trainTuneParetoClassifier

Examples

Run this code
# train an SVM classifier
cl <- tunePareto.svm()
tr <- trainTuneParetoClassifier(cl, 
                                iris[,-ncol(iris)], 
                                iris[,ncol(iris)], 
                                cost=0.001)

# re-apply the classifier to predict the training data
print(iris[,ncol(iris)])
print(predict(tr, iris[,-ncol(iris)]))

Run the code above in your browser using DataLab