predict.TWIX {TWIX}R Documentation

Predictions from a TWIX Object

Description

The result is a data frame, whose rows are prediction values from appointed tree(s).

Usage

## S3 method for class 'TWIX':
predict(object,newdata,sq=1,ccr=FALSE,...)

Arguments

object an object returned from TWIX function.
newdata data frame containing the new data(test data).
sq Integer vector indicating for which trees predictions are required.
ccr logical. If TRUE the result is a list of two components: a data frame with prediction values and correct classification rate of trees. This parameter can be ignored, if the function TWIX has been called call with test data (test.data=test).
... additional arguments affecting the predictions produced

See Also

TWIX, plot.TWIX

Examples

data(olives)
i <- sample(572,150)
ic <- setdiff(1:572,i)
training <- olives[ic,]
test <- olives[i,]
#
#Tree<-TWIX(Region~.,training,topN=c(5,2),method="local")
#pred<-predict(Tree,newdata=test,sq=1:2)
#
#predict(Tree,newdata=test,sq=1:5,ccr=TRUE)$CCR

[Package TWIX version 0.2.1 Index]