predict_RF: preidict function for random forest objects in statTarget

Description Usage Arguments Value Author(s) See Also Examples

View source: R/predict_RF.R

Description

Prediction of test data using random forest in statTarget.

Usage

1
predict_RF(object, newdata, type='response',...)

Arguments

object

An object created by the function statTarget_rForest.

newdata

A data frame or matrix containing new data. (Note: If not given, the out-of-bag prediction in object is returned. see randomForest package.

type

One of response, prob. or votes, indicating the type of output: predicted values, matrix of class probabilities, or matrix of vote counts. class is allowed, but automatically converted to 'response', for backward compatibility.

...

A generic predict function from randomForest package.

Value

A class of predicted values is returned. Object type is classification, for detail see randomForest package.

Author(s)

Hemi Luan, hemi.luan@gmail.com

See Also

randomForest

Examples

1
2
3
4
5
datpath <- system.file('extdata',package = 'statTarget')
statFile <- paste(datpath,'data_example.csv', sep='/')
getFile <- read.csv(statFile,header=TRUE)
rFtest <- rForest(getFile,ntree = 10,times = 5)
predictOutput <- predict_RF(rFtest, getFile[1:19,3:8])

13479776/statTarget documentation built on Aug. 14, 2020, 1:58 p.m.