RandomForestClassifierOptions<T>
Options & Configuration · AiDotNet.Models.Options
Configuration options for Random Forest classifiers.
Inheritance: ModelOptions → ClassifierOptions<T> → RandomForestClassifierOptions<T>
For Beginners
Random Forest is like asking many decision trees for their opinion!
Imagine you’re trying to classify a flower species:
- Create many decision trees, each trained on a random subset of your data
- Each tree considers only a random subset of features at each split
- To classify a new flower, ask all trees and take a vote
Why does this work so well?
- Each tree is slightly different due to random sampling
- Averaging many “weak” trees often creates a “strong” classifier
- It’s much harder to overfit than a single deep tree
Random Forest is one of the most popular algorithms because it:
- Works well with default settings
- Handles both classification and regression
- Is robust to outliers and noise
- Provides feature importance scores
How It Works
Random Forest is an ensemble learning method that constructs multiple decision trees during training and outputs the class that is the mode (most frequent) of the classes predicted by individual trees.
Constructors
| Constructor | Summary |
|---|---|
RandomForestClassifierOptions() |
Properties
| Property | Summary |
|---|---|
ClassificationSplitCriterion Criterion { get; set; } |
Gets or sets the criterion used to measure the quality of a split. |
MaxFeatureSelection MaxFeatures { get; set; } |
Gets or sets the number of features to consider when looking for the best split. |
bool Bootstrap { get; set; } |
Gets or sets whether to use bootstrap sampling. |
bool OobScore { get; set; } |
Gets or sets whether to compute out-of-bag score during training. |
double MinImpurityDecrease { get; set; } |
Gets or sets the minimum impurity decrease required for a split. |
int MinSamplesLeaf { get; set; } |
Gets or sets the minimum number of samples required at a leaf node. |
int MinSamplesSplit { get; set; } |
Gets or sets the minimum number of samples required to split an internal node. |
int NEstimators { get; set; } |
Gets or sets the number of trees in the forest. |
int NJobs { get; set; } |
Gets or sets the number of jobs for parallel training. |
int? MaxDepth { get; set; } |
Gets or sets the maximum depth of each tree. |
int? MaxFeatureCount { get; set; } |
Gets or sets an explicit feature count per split, overriding MaxFeatures. |