YDF - Yggdrasil Decision Forests for Python
YDF is a library for training, serving, and interpreting decision forest models. It acts as a lightweight, efficient wrapper around the C++ Yggdrasil Decision Forests library.
It provides fast access to core methods along with advanced features for model import/export, evaluation, and inspection.
YDF is the official successor to TensorFlow Decision Forests (TF-DF) and is recommended for new projects due to its superior performance and features.
Installation
Install YDF from PyPI:
pip install ydf
For detailed build instructions, see INSTALLATION.md.
Usage Example
import ydf
import pandas as pd
# Load dataset
ds_path = "https://raw.githubusercontent.com/google/yggdrasil-decision-forests/main/yggdrasil_decision_forests/test_data/dataset"
train_ds = pd.read_csv(f"{ds_path}/adult_train.csv")
test_ds = pd.read_csv(f"{ds_path}/adult_test.csv")
# Train a Gradient Boosted Trees model
model = ydf.GradientBoostedTreesLearner(label="income").train(train_ds)
# Evaluate the model
print(model.evaluate(test_ds))
# Save the model
model.save("my_model")
# Load the model
loaded_model = ydf.load_model("my_model")
Documentation
For more information, visit the YDF Documentation.
Frequently asked questions are available in the FAQ.
Metadata
Release files for ydf 0.16.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| ydf-0.16.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details |
| ydf-0.16.1-cp313-cp313-macosx_12_0_arm64.whl | CPython 3.13 | CPython 3.13 | macOS 12.0+ ARM64 | Details |
| ydf-0.16.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 | Details |
| ydf-0.16.1-cp312-cp312-macosx_12_0_arm64.whl | CPython 3.12 | CPython 3.12 | macOS 12.0+ ARM64 | Details |
| ydf-0.16.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 | Details |
| ydf-0.16.1-cp311-cp311-macosx_12_0_arm64.whl | CPython 3.11 | CPython 3.11 | macOS 12.0+ ARM64 | Details |
| ydf-0.16.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 | Details |
| ydf-0.16.1-cp310-cp310-macosx_12_0_arm64.whl | CPython 3.10 | CPython 3.10 | macOS 12.0+ ARM64 | Details |
| ydf-0.16.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.9 | CPython 3.9 | Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 | Details |
| ydf-0.16.1-cp39-cp39-macosx_12_0_arm64.whl | CPython 3.9 | CPython 3.9 | macOS 12.0+ ARM64 | Details |
Total release size: 108.0 MB
Release files / ydf-0.16.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | ydf-0.16.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 13.4 MB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
cc11a283be95dfa97112e16e13055a6640bdf84bc4517a4cf44c77c131723980
|
|
BLAKE2b-256 checksum How to use checksums |
e3add89f2ac54214db9c25d53480c3c2fa63adc817c8f99b4de754e1dc0257f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / ydf-0.16.1-cp313-cp313-macosx_12_0_arm64.whl
| Download URL | ydf-0.16.1-cp313-cp313-macosx_12_0_arm64.whl |
|---|---|
| Size | 8.2 MB |
| Tags | CPython 3.13 macOS 12.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e09f1273f4d207926e5ef49f58b5dacfe4ba7459f709c425412543805678c1dd
|
|
BLAKE2b-256 checksum How to use checksums |
0424a19c0f33063985db5bfa74b62480a346897a35842cbb312faf0c5cdda61d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / ydf-0.16.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | ydf-0.16.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 13.4 MB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
05e6639d6d1d65bf5f5ba9f9c686001391d43f6e37ee693f0cabe9a2ab122e18
|
|
BLAKE2b-256 checksum How to use checksums |
4941bc38018dc21152a3c2a088be7a517863073d934cfbac9931c0d40143f5f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / ydf-0.16.1-cp312-cp312-macosx_12_0_arm64.whl
| Download URL | ydf-0.16.1-cp312-cp312-macosx_12_0_arm64.whl |
|---|---|
| Size | 8.2 MB |
| Tags | CPython 3.12 macOS 12.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
839f723552a16ea9aeb16f093845c193dbed3eb4173ce208f19e048a51417e52
|
|
BLAKE2b-256 checksum How to use checksums |
b048af820787a337389b77129f2ac5e124e40e07122da6b9b4662e5533f9dd7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / ydf-0.16.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | ydf-0.16.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 13.4 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
1cbca1247fe2e26fe952499eb4d0b322cacf82b4c181848284cbef91f4cf5db4
|
|
BLAKE2b-256 checksum How to use checksums |
b6702daaac009f1c34292f5609512773275b2c714312169cd7999ef74df0566d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / ydf-0.16.1-cp311-cp311-macosx_12_0_arm64.whl
| Download URL | ydf-0.16.1-cp311-cp311-macosx_12_0_arm64.whl |
|---|---|
| Size | 8.2 MB |
| Tags | CPython 3.11 macOS 12.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
4acff9b2713b397cb69ec3c9f059c0d3b01244afb5704edcb68a5a2209ed7c5d
|
|
BLAKE2b-256 checksum How to use checksums |
54a7815db6093427d3b9b06f8fea755adc4e43e1b786dc8b5c06f5a8ce35f083
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / ydf-0.16.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | ydf-0.16.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 13.4 MB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
d99910ea2a2ff9fd332763b7e9609d1c00662314cbe8066330d629efbc5488c8
|
|
BLAKE2b-256 checksum How to use checksums |
14d130995128a136c20a9920bebd4c7ee10286bdc8049d151e1ad783b31fa59b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / ydf-0.16.1-cp310-cp310-macosx_12_0_arm64.whl
| Download URL | ydf-0.16.1-cp310-cp310-macosx_12_0_arm64.whl |
|---|---|
| Size | 8.2 MB |
| Tags | CPython 3.10 macOS 12.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a3f37401323f37ebe251d6ffbc7b9f6096d6ede9b1f8d30cb4e6babc0c7300b0
|
|
BLAKE2b-256 checksum How to use checksums |
769161f3fb70c0254a94ea5f674d7ccf4ad58a4c442de10e2e544048e1a73b0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / ydf-0.16.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | ydf-0.16.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 13.4 MB |
| Tags | CPython 3.9 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
51346899096a2332224e3e6bc1eb25a42d35da20e2ecb939c0cd409ea6fbec12
|
|
BLAKE2b-256 checksum How to use checksums |
7010b3048ed73b2825f1109888d0668c5d7bccb04d78387781406a08838e2a23
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / ydf-0.16.1-cp39-cp39-macosx_12_0_arm64.whl
| Download URL | ydf-0.16.1-cp39-cp39-macosx_12_0_arm64.whl |
|---|---|
| Size | 8.2 MB |
| Tags | CPython 3.9 macOS 12.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f48f7b7d1c7cba4a19480ad77246254de2f69e647f2fb44ce983aef53c4e2735
|
|
BLAKE2b-256 checksum How to use checksums |
2a896dfc16f04ddff8aaef976e7808d6f43a9d566ace229c88103635be434b3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|