skillfed

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.

ydf v0.16.1 439.8K downloads/30d#6,651 on PyPI668
Permissive license Apache 2.0 Active released

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 ydf

uv

uv add ydf

poetry

poetry add ydf

Installing 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

Intended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: MathematicsTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

decision forest machine learninggradient boosted trees pythonrandom forest trainingtree ensemble modelsmodel evaluation and inspectiondecision tree classificationmodel import export
decision-forestsgradient-boostingtabular-ml

More Software Development packages