boosters.GBLinearConfig#
- class boosters.GBLinearConfig#
Bases:
objectMain configuration for GBLinear model.
GBLinear uses gradient boosting to train a linear model via coordinate descent. Simpler than GBDT but can be effective for linear relationships.
- Parameters:
n_estimators – Number of boosting rounds. Default: 100.
learning_rate – Step size for weight updates. Default: 0.5.
objective – Loss function for training. Default: Objective.Squared().
metric – Evaluation metric. None uses objective’s default.
l1 – L1 regularization (alpha). Encourages sparse weights. Default: 0.0.
l2 – L2 regularization (lambda). Prevents large weights. Default: 0.0.
early_stopping_rounds – Stop if no improvement for this many rounds.
seed – Random seed for reproducibility. Default: 42.
Examples
>>> config = GBLinearConfig( ... n_estimators=200, ... learning_rate=0.3, ... objective=Objective.logistic(), ... l2=0.1, ... )
- classmethod __new__(*args, **kwargs)#
- early_stopping_rounds#
Early stopping rounds (None = disabled).
- l1#
L1 regularization (alpha).
- l2#
L2 regularization (lambda).
- learning_rate#
Learning rate (step size).
- max_delta_step#
Maximum per-coordinate Newton step (stability), in absolute value.
Set to 0.0 to disable.
- metric#
Get the evaluation metric (or None).
- n_estimators#
Number of boosting rounds.
- objective#
Get the objective function.
- seed#
Random seed.
- update_strategy#
Coordinate descent update strategy.
- verbosity#
Verbosity level for training output.