Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

randomForestPredict

Random Forest Prediction


Description

Random Forest prediction via predict.ranger. Predicts response variables from predictor variables, using ranger objects. All ranger objects have to work on the same set of prediction variables. These variables are exactly available in the prediction dataset. A response is not necessary, it will be predicted via this function.

Usage

randomForestPredict(
  dataset = cs.in.dataset(),
  preds = cs.in.predictors(),
  robject = cs.in.Robject(),
  return.results = FALSE,
  ...
)

Arguments

dataset

[data.frame]
Dataset with named columns. The names correspond to predictors and responses.

preds

[character]
Character vector of predictor variables.

robject

[list]
Named list of ranger object(s) set via Cornerstone menu "Input R Objects".

return.results

[logical(1)]
If FALSE the function returns TRUE invisibly. If TRUE, it returns a list of results. Default is FALSE.

...

[ANY]
Additional arguments to be passed to ranger . Please consider possible script variables (scriptvars) to prevent duplicates.

Value

Logical [TRUE] invisibly and outputs to Cornerstone or, if return.results = TRUE, list of resulting data.frame objects:

predictions

Dataset to brush with predicted values for dataset. The original input and other columns can be added to this dataset through the menu Columns -> Add from Parent ....

See Also


CornerstoneR

Collection of Scripts for Interface Between 'Cornerstone' and 'R'

v2.0.2
GPL-3
Authors
Gerrith Djaja [aut, cre], Dirk Surmann [aut] (<https://orcid.org/0000-0003-0873-137X>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.