Collection of training and inference decision forest algorithms.
Project description
TensorFlow Decision Forests (TF-DF) is a collection of state-of-the-art algorithms for the training, serving and interpretation of Decision Forest models. The library is a collection of Keras models and supports classification, regression and ranking.
TF-DF is a TensorFlow wrapper around the Yggdrasil Decision Forests C++ libraries. Models trained with TF-DF are compatible with Yggdrasil Decision Forests' models, and vice versa. This link explains how to do inference of TF-DF models in C++ using Yggdrasil.
Usage example
A minimal end-to-end run looks as follow:
import tensorflow_decision_forests as tfdf
import pandas as pd
# Load the dataset in a Pandas dataframe.
train_df = pd.read_csv("project/train.csv")
test_df = pd.read_csv("project/test.csv")
# Convert the dataset into a TensorFlow dataset.
train_ds = tfdf.keras.pd_dataframe_to_tf_dataset(train_df, label="my_label")
test_ds = tfdf.keras.pd_dataframe_to_tf_dataset(test_df, label="my_label")
# Train the model
model = tfdf.keras.RandomForestModel()
model.fit(train_ds)
# Look at the model.
model.summary()
# Evaluate the model.
model.evaluate(test_ds)
# Export to a TensorFlow SavedModel.
# Note: the model is compatible with Yggdrasil Decision Forests.
model.save("project/model")
Documentation & Resources
The following resources are available:
- TF-DF on TensorFlow.org (API Reference, Guides and Tutorials)
- Tutorials (on tensorflow.org)
- Issue tracker
- Known issues
- Changelog
- Forum (on discuss.tensorflow.org)
- Yggdrasil documentation (for advanced users and C++ serving)
- More examples
Installation
To install TensorFlow Decision Forests, run:
pip3 install tensorflow_decision_forests --upgrade
See the installation page for more details, troubleshooting and alternative installation solutions.
Contributing
Contributions to TensorFlow Decision Forests and Yggdrasil Decision Forests are welcome. If you want to contribute, make sure to review the developer manual and contribution guidelines.
Credits
TensorFlow Decision Forests was developed by:
- Mathieu Guillame-Bert (gbm AT google DOT com)
- Jan Pfeifer (janpf AT google DOT com)
- Sebastian Bruch (sebastian AT bruch DOT io)
- Arvind Srinivasan (arvnd AT google DOT com)
License
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 tensorflow_decision_forests-1.0.0rc0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: tensorflow_decision_forests-1.0.0rc0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 31.7 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50de59c2c71e1160ab6f49239664e46e2214fb5835263f375db912009204881b |
|
MD5 | 77bea26037eb590a094973bdcdfd1089 |
|
BLAKE2b-256 | 1c648be200dd5a2f011ac80089963fbda60b2110eb0d7e4bc10f314cca48e3b2 |
File details
Details for the file tensorflow_decision_forests-1.0.0rc0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: tensorflow_decision_forests-1.0.0rc0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 31.7 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba182006d321ea69304fcfe0b4a9b5923e217211f0e5b7bebfbfc9d94cf6b985 |
|
MD5 | db8d27c31f07a10bd05c1cbb3ab20151 |
|
BLAKE2b-256 | f0a717938f8aa966f6953fcbaa98797faa6b04bb11bf7aff55ecf8d986332c0b |
File details
Details for the file tensorflow_decision_forests-1.0.0rc0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: tensorflow_decision_forests-1.0.0rc0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 31.7 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9acb8af510b40e2f6319571c160e12adc2ce3e7611bd46ae43e52b354884a182 |
|
MD5 | 344ac0070b2f79489679151f8db83a19 |
|
BLAKE2b-256 | ef323927ca74aef38bb6de49e5e94fe360ced2a4c28d7f25ae1138aed1602b92 |
File details
Details for the file tensorflow_decision_forests-1.0.0rc0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: tensorflow_decision_forests-1.0.0rc0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 31.7 MB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7ccd4daedb8b2cdf9535764f88c72fb8bbe3e9ff7af92682079138943f7a775 |
|
MD5 | 647b75f420dc554e10b2558063ee0ac5 |
|
BLAKE2b-256 | 6fbfbaa4e8e9597772dec384746edca4cfa0c16562d8bef5fc45fdcb8452d3a1 |