fit_rf: Fit Random Forest

View source: R/multivariate.R

fit_rfR Documentation

Fit Random Forest

Description

Fits a random forest, where given response column in pheno data is predicted using the features. Can be used both for classification and regression. For more information, see the documentation of randomForest::randomForest. After fitting the random forest, use rf_importance as a shortcut for getting the feature importance in random forest prediction.

Usage

fit_rf(
  object,
  y,
  all_features = FALSE,
  covariates = NULL,
  importance = TRUE,
  ...
)

Arguments

object

a MetaboSet object

y

character, column name of phenoData giving the dependent variable of the model

all_features

logical, should all features be included in the model? if FALSE, flagged features are left out

covariates

character, column names of pData to use as covariates in the model, in addition to molecular features

importance

Should importance of features be assessed?

...

other parameters passed to randomForest::randomForest

Value

An object of class randomForest

See Also

randomForest, importance_rf

Examples

rf <- fit_rf(example_set, y = "Group")
rf
importance_rf(rf)


antonvsdata/notame documentation built on Sept. 14, 2024, 11:09 p.m.