XGBoost¶
flowcean.xgboost provides boosted classification and regression learners and models.
Install the xgboost extra as described in installation.
xgboost
¶
Classes¶
XGBoostClassifierLearner
¶
XGBoostClassifierLearner(threshold: float = 0.5, callbacks: list[LearnerCallback] | LearnerCallback | None = None, **kwargs: Any)
Bases: SupervisedLearner
Wrapper for XGBoost classifiers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
float
|
Decision threshold for binary classification (default: 0.5). |
0.5
|
callbacks
|
list[LearnerCallback] | LearnerCallback | None
|
Optional callbacks for progress feedback. Use |
None
|
**kwargs
|
Any
|
Arguments passed to XGBClassifier (n_estimators, max_depth, etc.) |
{}
|
XGBoostRegressorLearner
¶
XGBoostRegressorLearner(callbacks: list[LearnerCallback] | LearnerCallback | None = None, **kwargs: Any)
Bases: SupervisedLearner
Wrapper for XGBoost regressor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callbacks
|
list[LearnerCallback] | LearnerCallback | None
|
Optional callbacks for progress feedback. Use |
None
|
**kwargs
|
Any
|
Arguments passed to XGBRegressor (n_estimators, max_depth, etc.) |
{}
|
XGBoostClassifierModel
¶
XGBoostClassifierModel(classifier: XGBClassifier, *, input_features: list[str], output_features: list[str], threshold: float = 0.5)
Bases: Model
Wrapper for an XGBoost classifier model with threshold support.
Attributes¶
Methods:¶
predict_proba
¶
Predict class probabilities, applying preprocessing transforms.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_features
|
LazyFrame
|
The inputs for which to predict probabilities. |
required |
Returns:
| Type | Description |
|---|---|
LazyFrame
|
The predicted probabilities for the positive class. |