predict.TuneParetoModel: Prediction method for TuneParetoClassifier objects

View source: R/classifiers.R

predict.TuneParetoModelR Documentation

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 class 'TuneParetoModel'
predict(object, 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.

Value

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

See Also

tuneParetoClassifier, predefinedClassifiers, trainTuneParetoClassifier

Examples

# 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)]))

TunePareto documentation built on Oct. 2, 2023, 5:06 p.m.