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.
Project description
Port of Yggdrasil / TensorFlow Decision Forests for Python
The Python port of Yggdrasil Decision is a light-weight wrapper around Yggdrasil Decision Forests. It allows direct, fast access to YDF's methods and it also offers advanced import / export, evaluation and inspection methods. While the package is called YDF, the wrapping code is sometimes lovingly called PYDF.
YDF is the successor of Tensorflow Decision Forests (TF-DF). TF-DF is still maintained, but new projects should choose YDF for improved performance, better model quality and more features.
Installation
To install YDF, in Python, simply grab the package from pip:
pip install ydf
For build instructions, see INSTALLATION.md.
Usage Example
import ydf
import pandas as pd
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")
model = ydf.GradientBoostedTreesLearner(label="income").train(train_ds)
print(model.evaluate(test_ds))
model.save("my_model")
loaded_model = ydf.load_model("my_model")
Frequently Asked Questions
See the FAQ in the documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file ydf-0.11.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ydf-0.11.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 12.0 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a2f84424e487837e014514cdcfad2ac86c62c87e93c3762322aac55b7dfbff4 |
|
MD5 | e75deed77904f0e6ea4b71d8a3c25e83 |
|
BLAKE2b-256 | 14271f5d770a4fd71b1c28b1ad83af4314a5ecd957cff5d782635c1828541146 |
File details
Details for the file ydf-0.11.0-cp312-cp312-macosx_12_0_arm64.whl
.
File metadata
- Download URL: ydf-0.11.0-cp312-cp312-macosx_12_0_arm64.whl
- Upload date:
- Size: 8.9 MB
- Tags: CPython 3.12, macOS 12.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33ff5976878da5e06b7084f97ab0d7a18a808f6c84154e07a60edc1abda945be |
|
MD5 | de25b883ae113d059a8e61057e9aa1e8 |
|
BLAKE2b-256 | 050f6869a6be10a4d0f6ce4386511044e520f0824fef0c8d3825ed3ec84c4929 |
File details
Details for the file ydf-0.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ydf-0.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 12.0 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4178b24d7830137a9fcf89f813367a03c535dcb484ce76f7bb3145d2ea9ac63 |
|
MD5 | 3bf4766b6f5154f574824f9ccdab92fe |
|
BLAKE2b-256 | 3b0126ab8270e6dfb24282f36cb6d302832c0a63c92cb1fc16ca90bba33c9139 |
File details
Details for the file ydf-0.11.0-cp311-cp311-macosx_12_0_arm64.whl
.
File metadata
- Download URL: ydf-0.11.0-cp311-cp311-macosx_12_0_arm64.whl
- Upload date:
- Size: 8.9 MB
- Tags: CPython 3.11, macOS 12.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56305929ab34cca7aee1003f5056d4a71fc956487876f6cb715c6a053c5115fb |
|
MD5 | 61ca39505514393b7920adb4a37cf734 |
|
BLAKE2b-256 | f1bc80e6356af5d511d5d3c4de5b8537c84dda3d84968a0dab837bc8ea774750 |
File details
Details for the file ydf-0.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ydf-0.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 12.0 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ad96bdf8114ee5fa60e81e5bc1e48d8d3d1ab4dbdcacac12817fe9558eacc70 |
|
MD5 | aa24bcdf6dfa453402372d90e08dbbf4 |
|
BLAKE2b-256 | 0e2525640bfc2e1193592222b450d1ba758ca66160bb6aae0fa04b088b37a592 |
File details
Details for the file ydf-0.11.0-cp310-cp310-macosx_12_0_arm64.whl
.
File metadata
- Download URL: ydf-0.11.0-cp310-cp310-macosx_12_0_arm64.whl
- Upload date:
- Size: 8.9 MB
- Tags: CPython 3.10, macOS 12.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3397c4d6ca7c20b74596a496564bdc2e2748af847625ebf50d880fe82cbf3a7 |
|
MD5 | d52e9b112fc4ef3dcb073abb42cf8303 |
|
BLAKE2b-256 | aed1a84e29ca49dafba993258cb8f1b9fc3591109957358213e1d3134ad969b3 |
File details
Details for the file ydf-0.11.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ydf-0.11.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 12.0 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0c4d8a5c79c7246411b24c98a9b20e0a45db9884f00c85108f884385b05bcd2 |
|
MD5 | 0d56547f6caa4c81803135318e30c764 |
|
BLAKE2b-256 | f9615f4a2bac0606e0fe64c702e73758992b9c631e212ef8d80d421186ce9aa3 |
File details
Details for the file ydf-0.11.0-cp39-cp39-macosx_12_0_arm64.whl
.
File metadata
- Download URL: ydf-0.11.0-cp39-cp39-macosx_12_0_arm64.whl
- Upload date:
- Size: 8.9 MB
- Tags: CPython 3.9, macOS 12.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a57c9b554c45e40995101a77040d0da763d9266a68123da5fba8410d7c568b42 |
|
MD5 | a3f3132d0c6d1134a254a074a5119c40 |
|
BLAKE2b-256 | d6352ec3d3f3f511c3580476e603f16e7dec475d48e3ff837edceef0b8cc735c |
File details
Details for the file ydf-0.11.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ydf-0.11.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 12.0 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b00dc2f7f1209f0dc6138c3ec44f99b374d31fe99f60ab0189e516d65923169 |
|
MD5 | 502cdad28bbdeff93b8b225fefea0f1e |
|
BLAKE2b-256 | e3b5e0b7c4afee6012915e3b60fc1733ee4ddbbe159a555179a181b88d5cc949 |
File details
Details for the file ydf-0.11.0-cp38-cp38-macosx_12_0_arm64.whl
.
File metadata
- Download URL: ydf-0.11.0-cp38-cp38-macosx_12_0_arm64.whl
- Upload date:
- Size: 8.9 MB
- Tags: CPython 3.8, macOS 12.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fd009ba2d03a624f6f513cb4477e6e7a0d96e26518310575ff3ab36795d500c |
|
MD5 | a8e2a89c2c638dafb8fb25c1b88669e5 |
|
BLAKE2b-256 | 7e7514226e89854aec28e0386dde8e0530cad973049341c3cb9fb65be0bd71c0 |