Learn R Programming

rpst (version 1.0.0)

predict.rpst: Make predictions from a "rpst" object

Description

Similar to other predict methods, which returns predictions from a fitted "rpst" object.

Usage

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

Arguments

object

Output from the rpst function.

newdata

New data used for prediction.

additional summary arguments.

Value

predict.rpst returns a dataframe that contain a new column "class", which contains the class labels of each sample.

References

Zhang, H., Legro, R. S., Zhang, J., Zhang, L., Chen, X., Huang, H., ... & Eisenberg, E. (2010). Decision trees for identifying predictors of treatment effectiveness in clinical trials and its application to ovulation in a study of women with polycystic ovary syndrome.. Human Reproduction, 25(10), 2612-2621.

See Also

print.rpst, predict.rpst, plot.rpst.

Examples

Run this code
#require(survival)
##not run##
#data <- gen.data(n = 100, p = 10, c = 2)
#tree <- rpst(data$data, minsize = 2)
#class = predict.rpst(tree,data$data)$class

data <- gen.data(n = 20, p = 5, c = 2)
tree <- rpst(data$data, minsize = 2)
class = predict.rpst(tree,data$data)$class

Run the code above in your browser using DataLab