predict.kernelFactory: Predict method for kernelFactory objects

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

View source: R/predict.kernelFactory.R

Description

Prediction of new data using kernelFactory.

Usage

1
2
3
## S3 method for class 'kernelFactory'
predict(object, newdata = NULL, predict.all = FALSE,
  ...)

Arguments

object

An object of class kernelFactory, as created by the function kernelFactory

newdata

A data frame with the same predictors as in the training data.

predict.all

TRUE or FALSE. If TRUE and rp and cp are 1 then the individual predictions of the random forest are returned. If TRUE and any of rp and cp or bigger than 1 then the predictions of all the members are returned.

...

Not used currently.

Value

A vector containing the response probabilities.

Author(s)

Authors: Michel Ballings and Dirk Van den Poel, Maintainer: Michel.Ballings@GMail.com

References

Ballings, M. and Van den Poel, D. (2013), Kernel Factory: An Ensemble of Kernel Machines. Expert Systems With Applications, 40(8), 2904-2913.

See Also

kernelFactory

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#Credit Approval data available at UCI Machine Learning Repository
data(Credit)
#take subset (for the purpose of a quick example) and train and test
Credit <- Credit[1:100,]
train.ind <- sample(nrow(Credit),round(0.5*nrow(Credit)))

#Train Kernel Factory on training data
kFmodel <- kernelFactory(x=Credit[train.ind,names(Credit)!= "Response"],
          y=Credit[train.ind,"Response"], method=random)

#Deploy Kernel Factory to predict response for test data
predictedresponse <- predict(kFmodel, newdata=Credit[-train.ind,names(Credit)!= "Response"])

wrathematics/kernelFactory documentation built on May 4, 2019, 9:52 a.m.