random_forest: Fits a random forest from a matrix or features X and a vector...

View source: R/random_forest.R

random_forestR Documentation

Fits a random forest from a matrix or features X and a vector y.

Description

Fits a random forest from a matrix or features X and a vector y.

Usage

random_forest(X, y, W = NULL, k = 10, n = 500)

Arguments

X

n x m numerical matrix of features (missing values will be removed by sample).

y

Length n vector of numerical values (missing values will be removed by column).

W

n row numerical matrix of confounders to be included in each model (after selection).

k

Integer number of cross validation cycles to perform.

n

Number of features to be considered in the model (after correlation filter).

Value

A list with components:

model_table

A table with the following columns:
feature: the column names of X.
RF.imp.mean: an estimate of the importance of that feature for model accuracy.
RF.imp.sd: the standard deviation of the importance estimate.
RF.imp.stability: the proportion of models that used this feature.
rank: the rank of the feature in terms of importance for the model.
MSE: the mean-squared error of the model.
MSE.se: the standard error of the MSE.
R2: the R^2 of the model.
PearsonScore: the Pearson correlation of predicted and observed responses.

predictions

A vector of the responses predicted by the random forest.


broadinstitute/cdsr_models documentation built on Aug. 9, 2022, 10:36 a.m.