A random forest classifies or predicts by averaging an ensemble of decorrelated decision trees, reporting out-of-bag error and variable importance.
Each tree is grown on a bootstrap sample using a random subset of predictors per split; averaging many decorrelated trees slashes variance. Observations not in a tree's bootstrap sample (out-of-bag) provide honest error estimates without a holdout set.
Outcome type is auto-detected: categorical → classification (OOB accuracy + confusion), numeric → regression (OOB %variance explained + MSE).
Importance: mean decrease in accuracy (permutation-based, more reliable) and mean decrease in Gini / node purity (fit-based, fast).
Outcome (categorical or numeric) + numeric predictors + number of trees.
OOB accuracy/confusion (classification) or %Var/MSE (regression) + sorted variable-importance table.
OOB accuracy is comparable to cross-validation. Importance ranks predictors; permutation importance (MDA) is the safer of the two columns.