torch_frame.gbdt.XGBoost
- class XGBoost(task_type: TaskType, num_classes: Optional[int] = None, metric: Optional[Metric] = None)[source]
Bases:
GBDTAn XGBoost model implementation with hyper-parameter tuning using Optuna.
This implementation extends GBDT and aims to find optimal hyperparameters by optimizing the given objective function.
- objective(trial: Any, dtrain: Any, dvalid: Any, num_boost_round: int, early_stopping_rounds: int) float[source]
Objective function to be optimized.
- Parameters:
trial (optuna.trial.Trial) – Optuna trial object.
dtrain (xgboost.DMatrix) – Train data.
dvalid (xgboost.DMatrix) – Validation data.
num_boost_round (int) – Number of boosting round.
early_stopping_rounds (int) – Number of early stopping rounds.
- Returns:
Best objective value. Root mean squared error for regression task and accuracy for classification task.
- Return type: