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.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.3 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

tensorflow_decision_forests-1.8.0-cp311-cp311-macosx_12_0_arm64.whl (11.5 MB view details)

Uploaded CPython 3.11 macOS 12.0+ ARM64

tensorflow_decision_forests-1.8.0-cp311-cp311-macosx_10_15_x86_64.whl (12.4 MB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

tensorflow_decision_forests-1.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.3 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

tensorflow_decision_forests-1.8.0-cp310-cp310-macosx_12_0_arm64.whl (11.5 MB view details)

Uploaded CPython 3.10 macOS 12.0+ ARM64

tensorflow_decision_forests-1.8.0-cp310-cp310-macosx_10_15_x86_64.whl (12.4 MB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

tensorflow_decision_forests-1.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.3 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

tensorflow_decision_forests-1.8.0-cp39-cp39-macosx_12_0_arm64.whl (11.5 MB view details)

Uploaded CPython 3.9 macOS 12.0+ ARM64

tensorflow_decision_forests-1.8.0-cp39-cp39-macosx_10_15_x86_64.whl (12.4 MB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 41e7a1f90e0daf9aa9991a2befbf209b494ecb1b62ad00408960eb8f637fa9c0
MD5 6a5b75bab0759634dde22f0fc4edb60b
BLAKE2b-256 d480d60d714fede4c53542b75bf731da9328350b00c77bc58e9ac882697055a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.8.0-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 3ffc5fd3804dcdb8b026c636045dd93c0099837b16e1a975edfdd4e6168ed1b4
MD5 8dc482e19f24d4c115e73363c02e8d3a
BLAKE2b-256 30e8a2e0f8da873f62ee1441a5dae98fc8ae0ab0b16418821749f1ba82f5cbc4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.8.0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 9f3bf78bbfbe8b63a6a71bff60217bc5d723aeae496de65c949fee6e86ad6427
MD5 68fb3e1df4f13203ddfd1c1d38cc6f6b
BLAKE2b-256 2479884c776dba9eadd2b30968e90295d42fc56d5ba808d7926ce81ef606449d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eba3a226e2373c3313c5f4639eb9914e87a92ee3881d949a26e9563a048de743
MD5 a4700ea5dd53f1fb3ed829ff6c7bdf03
BLAKE2b-256 fbef4d67b55d32097b5332cb44f501146734d1700a7a40b7cf2e0ae7a3d06e21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.8.0-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 41154a6a2ba87c4f746b5d39d073eac1ac2944ed819c5dcaf73c6f247154807c
MD5 4c3fcfa9b33bb5cfae920d2ca4a38a2d
BLAKE2b-256 e7f1c20404d20723b5680b364fbd0c574806d1c9a8f21c869d79a5ee366a96d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.8.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 c286b40aee53afde8e269ee7377f2d929aa4bbf8f1d1eaf886abb86ddfe4661d
MD5 f92185fcd1cd168a12c700f317acca02
BLAKE2b-256 f94e010d54a29d57e44663ed24ae6639a3d755eb597c910e40e3f23c41a89022

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3759d7cff0964bf0253d9f163b1cbdbf0536f93a9da4f85fec31769258c39f9f
MD5 a62ce4f1a9893c2bb93c90d8b574f937
BLAKE2b-256 d0de516b08f45796eabab43b506505aed33e733b6d2e61ca28d995e486418aba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.8.0-cp39-cp39-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 32b8ff6ef9e54d090532abea73eb25ef36e69b52b1b4e97885b5513d251bb8a1
MD5 dbf2554c89e27f254b4b997b1e9ffeaa
BLAKE2b-256 8d60f6f448b52c191ec90e874fe226b3a282dabe4ff6d6b4083e84f239329fe7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.8.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 448ccb039943aa38e9f815c80c0cc046f70676586052c69897dfbdbb99aa1538
MD5 5acaed63cf499dc4ad758fcd35ad974f
BLAKE2b-256 a93a810c4034a0e360c6927a65c9c5e892f4307e497368a1768c89a7134a5cdf

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