Description Usage Arguments Value Examples
View source: R/tree.predictions.R
This method computes predicted outcome for each observation in the data frame using the tree model supplied as an input argument.
1  | tree.predictions(j, df, tree)
 | 
j | 
 the observation  | 
df | 
 A data frame containing the variables in the model.  | 
tree | 
 An object of class mob inheriting from
  | 
A vector of predicted outcome
1 2 3 4 5 6 7 8 9 10  | library(mlbench)
set.seed(1111)
# Random Forest analysis of model based recursive partitioning load data
data("BostonHousing", package = "mlbench")
data <- BostonHousing[1:90, c("rad", "tax", "crim", "medv", "lstat")]
fmBH <- mob.rf.tree(main_model = "medv ~ lstat", 
                     partition_vars = c("rad", "tax", "crim"), mtry = 2,
                     control = mob_control(), data = data, 
                     model = linearModel)
tree.predictions(j = 1, df = data, tree = fmBH@tree)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.