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.
It is not a replacement for its sister project Tensorflow Decision Forests (TF-DF). Instead, it complements TF-DF for use cases that cannot be solved through the Keras API.
Installation
To install YDF, in Python, simply grab the package from pip:
pip install ydf
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")
Compiling & Building
To build the Python port of YDF, install GCC-9 and run the following command from the root of the port/python directory in the YDF repository
PYTHON_BIN=python3.9
./tools/test_pydf.sh
./tools/build_pydf.sh $PYTHON_BIN
Frequently Asked Questions
- Is it PYDF or YDF? The name of the library is simply ydf, and so is the name of the corresponding Pip package. Internally, the team sometimes uses the name PYDF because it fits so well.
- What is the status of PYDF? PYDF is currently in Alpha development. Some parts still work well (training models and generating predictions), others are yet to be added. The API surface may still change without notice.
- Where is the documentation for PYDF? We are still creating the PYDF-specifc documentation, it will be hosted on https://ydf.readthedocs.org soon.
- How should I pronounce PYDF? The preferred pronunciation is "Py-dee-eff" / ˈpaɪˈdiˈɛf (IPA)
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
Hashes for ydf-0.0.3-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8915e10af67a1b899759925d8b55ae21ca532280c239c75c1266935fb8390c5e |
|
MD5 | 63c42c615afa8188ec1adb0c3815f827 |
|
BLAKE2b-256 | 3630eaf46f687d9f7a0247c81a79b457c14c509294fa207fae293004bf9db14b |
Hashes for ydf-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bffec555ac8c9293e4948271c98ee1b6894176df80138d2e566bb35c82fd98da |
|
MD5 | 619d72034375908ed3e28cfe7e5d81f4 |
|
BLAKE2b-256 | 215e2d53c75c0d699cf04d7933ab02cad4eb7cee184804133d6d7e3efcedb60e |
Hashes for ydf-0.0.3-cp311-cp311-macosx_13_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d492aca298b7e073bea8ced5c9a4f5e8a272605be7de046da454e20225bbeaea |
|
MD5 | a951ce85a7345e8bf4b0b439c3010b85 |
|
BLAKE2b-256 | 9bdd63d697bdaf10a938c706fc985b6a37240cb8d2d0f72f1695981e15e93052 |
Hashes for ydf-0.0.3-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b9052ceb0a201bbe5d564069274393a5d467e488759a30cade2a54f7dc3fb8f |
|
MD5 | 843aa387308a1546e6c8e2cfde0ce49a |
|
BLAKE2b-256 | 87f4cc323870e543bf228b3fead73b08ff0d6bbcae7d34bd05aa9956d0d04a5d |
Hashes for ydf-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75104af98e1a03000084011a4ce114f47add737dfa310732a0ee833c1bdf0c02 |
|
MD5 | 0a3e7c462ed3ec9617abfbdea85f516f |
|
BLAKE2b-256 | f50102cd4ae13ef121e23e4d708222ee75404b2aa2adaab41fb9c84083e09fbd |
Hashes for ydf-0.0.3-cp310-cp310-macosx_12_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e9b3b9cf78a675fcefba93af673d62135faeb87ca1efe1ff2499b6f5c9a856b |
|
MD5 | 526c10ea42774008694849ed3c650476 |
|
BLAKE2b-256 | 1c56890d3414139955627dcb35ed89a0ab4b33280b8aae8a5fb1b4b26aff96dd |
Hashes for ydf-0.0.3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7196f05566e872be2c5fed897695a4c998dcae4b236959dc0c68714bc2e7731c |
|
MD5 | a91797704256baadc57e6c77842146b4 |
|
BLAKE2b-256 | 6c832804c8ee06a1f0038cb265412724a3ba311f681a1d43c53da96ec3b9eb44 |
Hashes for ydf-0.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 313fd28836cf08a699b797eeab2b6d061ec9e77aa75c19532f824976d96888b2 |
|
MD5 | 862c0ce0b263db9f06da521f60eccd04 |
|
BLAKE2b-256 | de7f9ce643b540e51a08e1c2c3f9cd9c4753756b2963e989ca3848a333faa5e5 |
Hashes for ydf-0.0.3-cp39-cp39-macosx_12_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 762a25b67ccdad642a44766fe4cc4bf8791bdc3f6753ce84e1e55c3a7ef8bf8d |
|
MD5 | c9ea4361aaf0395054addbace8eec4f7 |
|
BLAKE2b-256 | f6ef1d9323e72974bf343b261e74f12db5a4a2bc493cd7464a05ec08451e3e45 |
Hashes for ydf-0.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e7a489a268c43b11d87f4d910eee7e7a479d139047036b7238c6010ec122841 |
|
MD5 | ce5ef7c8cde7987eac7f4bba3b7be7b5 |
|
BLAKE2b-256 | 83717e4a8139b70a984092cb245616917aa1b391cd0748eb44e502401b360149 |
Hashes for ydf-0.0.3-cp38-cp38-macosx_12_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0de0006a09b1d1cccd05ebbaeb45033d352bf6fba109562c6deb6d72a6bfd2a |
|
MD5 | b0b7ce96a6265ac46ed07c13c9b81b5b |
|
BLAKE2b-256 | 278c255529a10da69d479ba7c9206372e8588dd727e19d7a42ea9119110a9a93 |