Training XGBoost Models with GPU-Accelerated Polars DataFrames

AI-generated summary of reporting by NVIDIA Developer Blog. Read the original for the full story.

Why it matters

XGBoost 3.1 removes the manual category re-encoding step at inference time and lets Polars run DataFrame operations on GPUs, cutting friction and errors in GPU-accelerated training pipelines.

Read this as

XGBoost, a widely used machine-learning tool for building prediction models, has released version 3.1 with better handling of categorical data, categories like 'red' or 'blue' that must be converted to numbers before a model can process them. Previously, engineers had to convert these categories manually a second time when the model made predictions, which was error-prone. Now the model remembers the original conversion and reuses it automatically. This matters to data scientists who train models on GPUs.

NVIDIA's RAPIDS team and the XGBoost project shipped two practical upgrades in XGBoost 3.1: automatic handling of categorical data during prediction, and native support for Polars, a fast Rust-based DataFrame library, on GPUs. The gains are operational, fewer manual preprocessing steps and fewer prediction errors caused by mismatched category encodings. Teams with GPU training pipelines gain most; there are no benchmark numbers or cost figures in the post.

XGBoost 3.1 stores training-time category mappings in the booster and applies them at predict time, eliminating manual re-coding when test data contains a category subset; export via get_categories(export_to_arrow=True) returns PyArrow arrays, though the interface is experimental. Polars DataFrames reach XGBoost via zero-copy to_arrow (PyArrow required); calling collect(engine='gpu') executes the lazy query plan on GPU, but results stay in CPU memory, so XGBoost copies them to GPU with a one-time performance warning. Re-coding runs in-place on GPU across all categorical columns. The tutorial uses the Microsoft Malware Prediction Kaggle dataset.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

XGBoost Polars NVIDIA RAPIDS PyArrow Kaggle

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading