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

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

tensorflow_decision_forests-1.10.0-cp311-cp311-macosx_12_0_arm64.whl (11.8 MB view details)

Uploaded CPython 3.11 macOS 12.0+ ARM64

tensorflow_decision_forests-1.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.5 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

tensorflow_decision_forests-1.10.0-cp310-cp310-macosx_12_0_arm64.whl (11.8 MB view details)

Uploaded CPython 3.10 macOS 12.0+ ARM64

tensorflow_decision_forests-1.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.5 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

tensorflow_decision_forests-1.10.0-cp39-cp39-macosx_12_0_arm64.whl (11.8 MB view details)

Uploaded CPython 3.9 macOS 12.0+ ARM64

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 31cf84d9660c63219ae1aa3714d4df8b74b68be70483a8301c4fabd115ae19bb
MD5 db3647b59b8a244ed5fce53ebb1b94de
BLAKE2b-256 ff4f6b776c879070b97808ce176e238b7f26aeb68891a7f32499a7246ceeae06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.10.0-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 fe66ad8b969f97a5cfd5922313bef085048eb67a1bd8641b045e4c8bc06b6054
MD5 10380f46cb54b0de4bbc3a6bb569a380
BLAKE2b-256 b3d6cce9b8769d9bb19bfd1c13a17e508faedcbd418120e8eb650e74e7e5bdc3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 84a391cdf2e71b5f3d60f98222fbd39c6cbc1ebcc9cf57322732fcfce2222ff4
MD5 7e017421e3fd81673626d06589ff3842
BLAKE2b-256 f0615c3943666c90dbd9e073c3b5ec8a1475e5e2c83e9ca19a3f5ee10f163e4c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.10.0-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 d3fcf4720bba40b8f0a56371a3f126e6402d05b6576f6727a3a6369e4ce97b57
MD5 71206c202ef9f7fb5ff236eef1cb030c
BLAKE2b-256 f568d3dc09764e2bbeac1d65684fa37ca9a42a968c957757e0c1889911b2e398

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e66b3267f4fa20c8db6dff868e570c2839fa4aaaafde8a64bb50c0525046687d
MD5 e3d4f4d3afe7203229d3bd0580eaa187
BLAKE2b-256 a746ad47d728d9c51cc6c74c62b3dd62ac6155b1ed01c0d904a06c2f067b27b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.10.0-cp39-cp39-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 0c3e586889ca4a11e8e25834799d50cedefcef3e6452dfa0caeaf310823917e0
MD5 6ced7bcfe72baf8a2212061c57e5b663
BLAKE2b-256 0b6631b422db3092f1e6a7aa9b76a19ece284cdb9c89731c024a37d365d86a66

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