GradientBoostingClassifierOptions<T>
Options & Configuration · AiDotNet.Models.Options
Configuration options for Gradient Boosting classifier.
Inheritance: ModelOptions → ClassifierOptions<T> → GradientBoostingClassifierOptions<T>
For Beginners
Gradient Boosting is like iteratively fixing mistakes!
The process:
- Start with a simple prediction (like the average)
- Calculate how wrong we are (the residuals)
- Train a tree to predict those errors
- Add the tree’s predictions (scaled down) to improve our model
- Repeat many times
Key parameters to tune:
- n_estimators: More trees = potentially better but slower
- learning_rate: Lower values need more trees but often work better
- max_depth: Usually 3-8 works well (shallower than random forest)
Gradient Boosting often gives the best accuracy but:
- Takes longer to train
- More sensitive to hyperparameters
- More prone to overfitting if not tuned properly
How It Works
Gradient Boosting builds an ensemble of trees where each tree corrects the errors of the previous ones by fitting to the gradient of the loss function.
Constructors
| Constructor | Summary |
|---|---|
GradientBoostingClassifierOptions() |
Properties
| Property | Summary |
|---|---|
GradientBoostingLoss Loss { get; set; } |
Gets or sets the loss function. |
double LearningRate { get; set; } |
Gets or sets the learning rate (shrinkage). |
double MaxFeatures { get; set; } |
Gets or sets the fraction of features used for each tree. |
double MinImpurityDecrease { get; set; } |
Gets or sets the minimum impurity decrease for splitting. |
double Subsample { get; set; } |
Gets or sets the fraction of samples used for each tree. |
int MaxDepth { get; set; } |
Gets or sets the maximum depth of each tree. |
int MinSamplesLeaf { get; set; } |
Gets or sets the minimum samples required at a leaf. |
int MinSamplesSplit { get; set; } |
Gets or sets the minimum samples required to split. |
int NEstimators { get; set; } |
Gets or sets the number of boosting stages. |