The XGBoost pack has 7 rules, and xpd can fix 2 of them.
The XGBoost pack checks the native Python API and the scikit-learn estimators
against the XGBoost 3.4.2 documentation.
| Rule |
Severity |
Fix |
What it finds |
| removed-fit-keywords |
error |
none |
XGBoost 2.1 removed eval_metric, early_stopping_rounds and callbacks from the scikit-learn estimator's fit method. |
| removed-gpu-hist |
error |
unsafe |
XGBoost 3.1 removed the gpu_hist tree method. |
| ineffective-max-quantile-batches |
warning |
safe |
XGBoost 3.3 deprecated max_quantile_batches and made it ineffective. |
| Rule |
Severity |
Fix |
What it finds |
| quantile-eval-without-train-ref |
error |
none |
XGBoost train requires a separate QuantileDMatrix or ExtMemQuantileDMatrix used for evaluation to reference the exact matrix passed as dtrain. |
| reused-early-stopping-callback |
warning |
none |
XGBoost's EarlyStopping callback stores training history and a count of rounds without improvement. |
| Rule |
Severity |
Fix |
What it finds |
| native-predict-after-early-stopping |
warning |
none |
XGBoost's native Booster.predict and Booster.inplace_predict use all retained rounds by default, including any rounds after early stopping found the best validation score. |
| dmatrix-rebuilt-for-predict |
warning |
none |
XGBoost's Booster.inplace_predict can score supported batches for tree boosters without allocating a new DMatrix for each batch. |
ineffective-max-quantile-batches can remove a literal integer option.
removed-gpu-hist can migrate an estimator whose only option is the old
tree method. This fix is unsafe because it changes the device setup.
- Other configurations, reference changes, callback lifetimes and prediction
choices require manual edits. Autofix verification checks that rewritten
cases clear and that expected manual diagnostics remain.
The examples ran with the XGBoost CPU wheel at version 3.4.1 on 20 rows with
two features. The GPU migration uses the documented parameter values.
Python API reference