Skip to main content

Collection of training and inference decision forest algorithms.

Project description

TensorFlow Decision Forests (TF-DF) is a library to train, run and interpret decision forest models (e.g., Random Forests, Gradient Boosted Trees) in TensorFlow. TF-DF supports classification, regression and ranking.

TF-DF is powered by Yggdrasil Decision Forest (YDF, a library to train and use decision forests in C++, JavaScript, CLI, and Go. TF-DF models are compatible with YDF' models, and vice versa.

Tensorflow Decision Forests is available on Linux and Mac. Windows users can use the library through WSL+Linux.

Usage example

A minimal end-to-end run looks as follows:

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")

Google I/O Presentation

Documentation & Resources

The following resources are available:

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.

Citation

If you us Tensorflow Decision Forests in a scientific publication, please cite the following paper: Yggdrasil Decision Forests: A Fast and Extensible Decision Forests Library.

Bibtex

@inproceedings{GBBSP23,
  author       = {Mathieu Guillame{-}Bert and
                  Sebastian Bruch and
                  Richard Stotz and
                  Jan Pfeifer},
  title        = {Yggdrasil Decision Forests: {A} Fast and Extensible Decision Forests
                  Library},
  booktitle    = {Proceedings of the 29th {ACM} {SIGKDD} Conference on Knowledge Discovery
                  and Data Mining, {KDD} 2023, Long Beach, CA, USA, August 6-10, 2023},
  pages        = {4068--4077},
  year         = {2023},
  url          = {https://doi.org/10.1145/3580305.3599933},
  doi          = {10.1145/3580305.3599933},
}

Raw

Yggdrasil Decision Forests: A Fast and Extensible Decision Forests Library, Guillame-Bert et al., KDD 2023: 4068-4077. doi:10.1145/3580305.3599933

Contact

You can contact the core development team at decision-forests-contact@google.com.

Credits

TensorFlow Decision Forests was developed by:

  • Mathieu Guillame-Bert (gbm AT google DOT com)
  • Jan Pfeifer (janpf AT google DOT com)
  • Richard Stotz (richardstotz AT google DOT com)
  • Sebastian Bruch (sebastian AT bruch DOT io)
  • Arvind Srinivasan (arvnd AT google DOT com)

License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

tensorflow_decision_forests-1.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.8 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

tensorflow_decision_forests-1.6.0-cp311-cp311-macosx_12_0_arm64.whl (11.4 MB view details)

Uploaded CPython 3.11 macOS 12.0+ ARM64

tensorflow_decision_forests-1.6.0-cp311-cp311-macosx_10_15_x86_64.whl (12.3 MB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

tensorflow_decision_forests-1.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.8 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

tensorflow_decision_forests-1.6.0-cp310-cp310-macosx_12_0_arm64.whl (11.4 MB view details)

Uploaded CPython 3.10 macOS 12.0+ ARM64

tensorflow_decision_forests-1.6.0-cp310-cp310-macosx_10_15_x86_64.whl (12.3 MB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

tensorflow_decision_forests-1.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.8 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

tensorflow_decision_forests-1.6.0-cp39-cp39-macosx_12_0_arm64.whl (11.4 MB view details)

Uploaded CPython 3.9 macOS 12.0+ ARM64

tensorflow_decision_forests-1.6.0-cp39-cp39-macosx_10_15_x86_64.whl (12.3 MB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

File details

Details for the file tensorflow_decision_forests-1.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6b9b2793392bde0f297cbb4d3c6f1f7849d7b744d8c50f52f1035d65dad454a7
MD5 da72a41edb83b81ebf86f49d299730ec
BLAKE2b-256 f0fa744bc87e6d57b6c2ccf009b59a5eb9860f563b58bf99399b7a9a237e9e26

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-1.6.0-cp311-cp311-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.6.0-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 4cdab1270249650fc7d7c39fe46654a4fcf4fd3c96441f1fe34ba1b63912cfc7
MD5 98596c09f0b7ed5148ad4612fee01352
BLAKE2b-256 c9c952dc0460b730540bb953e2b184579f80d23818147e3f8968d55557c82a42

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-1.6.0-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.6.0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 5eb8a26026e9a31a4aef9e5e3e7e244a60341445ded195ffaa5c3c8fa2693622
MD5 4e2a13e5a44b32afd9efac3e3935b5fa
BLAKE2b-256 7876d9aad66749faa98c7cc1c9b4b41da89a7724376393eba3b585c8638d4ca0

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-1.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 99135187e59cd1d3cb2512ad58d0f3fdfdce86ef9c0e600ecd0d7f9a97ed26ce
MD5 4997e431e59d831c28d1c9172dfecb3e
BLAKE2b-256 b618ade33c2920daaee5ffa0a3516645b231a9dad26f25eacfec01a9a363ff5f

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-1.6.0-cp310-cp310-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.6.0-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 6b4c29a5591df6deb81c029f897b9f6a401691c0cd1a9c5e7308059e9150a74b
MD5 9e86b0bb2b77f0437fb678d9d4025ebd
BLAKE2b-256 0d22795db8b37f291b92fc96e18df57700a5c5ca22ed64f158148a63258ebef2

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-1.6.0-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.6.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 1ccc6f99bde123408ca95ebbb67d167b5e3a171704012d622b7d7a84a0e72981
MD5 b583c4cbea297288ca74503c5952f872
BLAKE2b-256 9866f98332fd0e726d243610de0b5802bd9b78688d03da0464124f6d13583fc4

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-1.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c14af07fcf5891f4f283235fdd41fd06d4a49b5ba7f93963ee7c718e37bb985a
MD5 daf2c0f6e7e535437f6452a11539f004
BLAKE2b-256 8670fa05c33db4bd9e7c4d4285a628f1127fd2d5a6aa5a3b324865f38f985bb1

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-1.6.0-cp39-cp39-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.6.0-cp39-cp39-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 9cb9cff4b5721a32ee340b2becdf59e451859cb8912349de9581898c9da8858a
MD5 381a6731717143aac61a69f5f174cb94
BLAKE2b-256 113d1b726c174b4ae644ebbd7849d6962f5375a3b87de84d9fbaa0ad107f5200

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-1.6.0-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.6.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 c113b66ae15fe0d22b869e66304a0436e6691b3a88e2346cb5041c0352a149b4
MD5 3e2a29d9704d6f64fa704824c6902372
BLAKE2b-256 d2f387e7f72781b9093bf5cc32b461405fa0fe82368cc580432c0cce51009286

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page