ydf
YDF (short for Yggdrasil Decision Forests) is a library for training, serving, evaluating and analyzing decision forest models such as Random Forest and Gradient Boosted Trees.
What it is and what it does
YDF is a Python library for building and working with decision forest models—Random Forests, Gradient Boosted Trees, and related ensemble methods. It wraps the C++ Yggdrasil Decision Forests engine to provide fast training, evaluation, and model inspection. The library is designed as the successor to TensorFlow Decision Forests and emphasizes performance and feature completeness for new projects.
Typical workflows involve loading data, instantiating a learner (e.g., GradientBoostedTreesLearner), training on a dataset, evaluating on test data, and saving or loading models. The package depends on numpy, absl_py, and protobuf for numerical computation and serialization. It supports Python 3.9 through 3.13 and is actively maintained.
Use it for:
- Train Gradient Boosted Trees or Random Forest classifiers for tabular data classification tasks.
- Evaluate and compare decision forest models on test datasets to measure performance.
- Export trained models for deployment or import pre-trained models for inference.
- Inspect and interpret decision forest models to understand feature importance and decision paths.
- Build ranking or uplift models using decision forest learners for specialized prediction tasks.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
YDF trains, evaluates, and interprets decision forest models (Random Forests, Gradient Boosted Trees, and others) through a Python wrapper around the C++ Yggdrasil Decision Forests library.
Yes, if you need to train or deploy decision forest models in Python and work with tabular data. The active maintenance, permissive Apache 2.0 license, and lack of known vulnerabilities make it a solid choice. Install friction is moderate due to compiled wheels, but prebuilt binaries cover common platforms and Python versions (3.9–3.13). Not suitable if you require platforms outside macOS ARM64 or Linux x86_64.
Install
ydf on PyPI
pip
pip install ydfuv
uv add ydfpoetry
poetry add ydfInstalling ydf
Before you install
Medium install friction due to compiled wheels; prebuilt binaries available for Python 3.9–3.13 on macOS (ARM64) and Linux (x86_64). Active maintenance with recent releases; last commit 2026-08-14.
License in practice
Apache 2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install ydf
import ydf
model = ydf.GradientBoostedTreesLearner(label="target").train(train_ds)
model.save("my_model")
Requires Python 3.9 or later; prebuilt wheels available only for Python 3.9–3.13 on macOS ARM64 and Linux x86_64.
Verify before relying
- Whether YDF's performance advantage over TensorFlow Decision Forests is quantified in benchmarks.
- Support status and timeline for platforms beyond macOS ARM64 and Linux x86_64.
- Whether all Yggdrasil Decision Forests features are exposed through the Python API.
Package facts
| License | Apache 2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 3 — numpy, absl_py, protobuf |
| Maintenance | actively maintained — 141 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 439,802/month — #6,651 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ydf-0.16.1-cp310-cp310-macosx_12_0_arm64.whl; ydf-0.16.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; ydf-0.16.1-cp311-cp311-macosx_12_0_arm64.whl; ydf-0.16.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; ydf-0.16.1-cp312-cp312-macosx_12_0_arm64.whl; ydf-0.16.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; ydf-0.16.1-cp313-cp313-macosx_12_0_arm64.whl; ydf-0.16.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; ydf-0.16.1-cp39-cp39-macosx_12_0_arm64.whl; ydf-0.16.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Keywords: machine, learning, decision, forests, random, forest, gradient, boosted, decision, trees, CART, isolation, forests, classification, regression, ranking, uplift, boosting
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
tensorflow-decision-forestsTrains and deploys decision forest models…
permissive · top 15,000 on PyPI
dtreevizdtreeviz renders decision trees from…
permissive · top 15,000 on PyPI
skope-rulesSkope-rules learns interpretable logical rules…
permissive · top 15,000 on PyPI
treeliteTreelite serializes and exchanges decision tree…
permissive · top 15,000 on PyPI
treeinterpreterDecomposes scikit-learn decision tree and…
permissive · top 15,000 on PyPI
quantile-forestQuantile regression forests for estimating…
permissive · top 15,000 on PyPI
py_treespy_trees implements behaviour trees in Python,…
permissive · top 15,000 on PyPI
yggdrasil-engineProvides Python bindings to the Unleash…
permissive · top 5,000 on PyPI
treelite-runtimeTreelite-runtime provides a Python runtime for…
permissive · top 15,000 on PyPI
geocifGenerates climatic impact drivers from Earth…
permissive · top 15,000 on PyPI