AI GLOSSARY · AI CONCEPTS
Random forest
Definition
A random forest combines predictions from many randomized decision trees. Bootstrap sampling and feature subsampling are common sources of diversity, but their use depends on the implementation and settings; classification and regression combine tree outputs differently.
Also called: random forests, random forest algorithm, random forest classifier, random forest regression, RF.
In plain language
A random forest is a crowd of decision trees that vote. A common configuration varies the sampled training examples and the features considered at splits, which can diversify the trees' errors. Other settings can use every training row or consider all features. For a question like whether a customer will cancel, the forest takes the majority answer, and the errors of single trees tend to cancel out. The scikit-learn guide says combining diverse trees reduces variance, which often gives a better model than one tree. The costs are that it is harder to read than a single tree, it needs more computing and memory, and it can still be wrong on data unlike what it was trained on. Someone still has to test it on examples it has not seen.
Technical definition
In scikit-learn's default classifier configuration, trees use bootstrap samples drawn with replacement and consider a random subset of features at each split. Setting bootstrap=False uses all training rows; feature subsampling depends on max_features. The guide says the purpose of these two sources of randomness is to decrease the variance of the forest estimator, and that the prediction is the average of the individual trees, which in scikit-learn means averaging probabilistic predictions rather than a single vote per tree. IBM describes the same pieces as bagging and feature randomness, with a majority vote for classification and averaging for regression. IBM says averaging uncorrelated trees lowers variance and prediction error, and lists feature importance among its uses, and time, resources and complexity as challenges.
Worked examples in this catalogue
Catalogue examples point at a skill, guide or coding tool listed on this site, with what to run and what you see. An example marked illustrative describes the item from its own documentation; it was not executed for this page. Platform Scores are our assessment under a published method, not a safety guarantee.
Skill by Skill Almanac · Illustrative, not executed
split-leakage-check 53/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- A JSON report on train, validation and test files that flags duplicates, shared groups, time leakage and label leakage between the splits.
- Why it exercises the concept
- The catalogue has no training skills, so this is a data check. A forest can fit its training rows very closely, and a score on a test set that shares rows with them says little. This skill checks the splits.
Skill by Skill Almanac · Illustrative, not executed
data-analysis-eda 56/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- A fixed exploratory-analysis procedure and CSV profiler that keeps findings descriptive, evidenced and caveated.
- Why it exercises the concept
- Not a training skill. Profiling a table first shows its columns, missing values and class balance, which is what a forest will be trained on.
Skill by Skill Almanac · Illustrative, not executed
mock-record-generator 42/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- Seeded mock records as CSV or JSON from a JSON field list or a simple TypeScript interface.
- Why it exercises the concept
- Not a training skill. Seeded fake records give a small repeatable table for a first try at a forest. Random forests are themselves random, so fixing a seed is how a run is repeated.
How it shows up when you use agents
Ask Claude Code, Codex or Cursor to predict something from a spreadsheet and a random forest is one method it may pick for a table of rows and columns. In scikit-learn it is RandomForestClassifier or RandomForestRegressor, and the agent may print a feature importance list with the result.
What breaks when this is misunderstood: people read the list as proof of cause, when it only shows which columns the trees split on. A forest can also reach a high score because of a leak in the data, not because it learned something real. That is a form of overfitting that the test score hides. Runs also differ from one another unless a random seed is fixed, so two runs of the same code can give slightly different numbers.
The safer habit is to ask the agent for the number of trees and depth settings, the seed, and the training and held-out scores together, with the splits checked for leaks. The catalogue has no skills for training models, so the skills on this page are data checks. A forest is a supervised learning method built from decision trees.
Common confusions
- Random forest versus decision tree. One tree is easy to read but can overfit and can change a lot with small changes in the data. A forest averages many trees to reduce that variance, at the price of being harder to read.
- Random forest versus other ensembles. A forest is one kind of tree ensemble. The scikit-learn ensemble page also covers bagging, voting, stacking and gradient boosting, which combine models in other ways.
- Reduced risk versus no risk. IBM says averaging uncorrelated trees lowers variance and prediction error, not that overfitting disappears.
- Feature importance versus causation. Importance describes how the model used a column. It does not show that changing that column would change the outcome.
Related terms
Terms that mention Random forest
4 terms mention this one
More in AI concepts
Sources
- What is random forest?, IBM (accessed 2026-11-24)
- Ensembles: Gradient boosting, random forests, bagging, voting, stacking, scikit-learn user guide (accessed 2026-11-24)
- RandomForestClassifier: bootstrap and max_features parameters, scikit-learn (accessed 2026-11-25)
Definitions are written by Skill Almanac from these sources and were checked against them on 2026-11-25. Wikipedia is never the only source.
Review record
Last verified
Drafted by Claude (original draft) and Codex (targeted revisions); sources and example targets checked by Independent automated source review (OpenAI Codex); not human peer review on 2026-11-25. Last verified .
Change log (5)
- : Independent automated factual/example review completed. Cached US query estimate aligned to receipt; no traffic promise. Final technical gate recorded separately; publication disabled.
- : First version.
- : Verifier pass: corrected IBM wording, softened agent behaviour claim.
- : Applied bounded batch06 source-scope repairs; independent affected-claim recheck pending.
- : Automated review completed; approved for the staged public release. Search indexing is controlled by the release configuration.