predict.rm_reg {randomMachines} | R Documentation |
Prediction function for the rm_reg_model
Description
This function predicts the outcome for a RM object model using new data for continuous y
Usage
## S4 method for signature 'rm_reg'
predict(object,newdata)
Arguments
object |
A fitted RM model object of class |
newdata |
A data frame or matrix containing the new data to be predicted. |
Value
Predicted values newdata
object from the Random Machines model.
Examples
# Generating a sample for the simulation
library(randomMachines)
sim_data <- sim_reg1(n = 75)
sim_new <- sim_reg1(n = 25)
rm_mod_reg <- randomMachines(y~., train = sim_data)
y_hat <- predict(rm_mod_reg, newdata = sim_new)
[Package randomMachines version 0.1.0 Index]