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 Distribution

tensorflow_decision_forests-1.8.1.tar.gz (15.2 MB view details)

Uploaded Source

Built Distributions

tensorflow_decision_forests-1.8.1-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.1-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.1-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.1-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.1-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.1-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.1-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.1-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.1-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.1.tar.gz.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.8.1.tar.gz
Algorithm Hash digest
SHA256 c3d3d37427d58fec58df4df5d86d55350969f69bae6f9d4775baffded1f25c79
MD5 ec9b8db36cf37663d68ee4d613d43d44
BLAKE2b-256 dd3c8d35b3099c0ff83c6411ef595eceef7864f28bb64a746d71287fa31ed15a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.8.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a3ba3ce08b21d1841229d5628256e41306066f3a1c70499ad676fa218fa5b85e
MD5 1ca8381e5f5d90cb39545ceb180629c9
BLAKE2b-256 fe998ab7830ed36b8892fd9c414bf41a5f03a96b62855d7c806d2b4aa4008d2d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.8.1-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 32d08bb14d537b1df1ef996c4a8c31e5d52f7c9536cb7f1b84b977ff8a94cf44
MD5 526eb23ac345de80142844c96ee9fc02
BLAKE2b-256 49dc50bf4c1e9a22c4fc4018f905c41c2ee1ca4f4394986f0a1576eb6fdb366f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.8.1-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 9982513b551511002104f0d73e04349eda3917debf90384e24a505100af4b9cf
MD5 8afdc7f2af1aa541bf9ab3a9e4680a14
BLAKE2b-256 da614ae92fbdbaab0d65b81ad7aa5a3a5b58c309e727d57dc15685e4a88ff7a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.8.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 693e85a66ec5c14a5e08f269747af646d2f096309afd53142a6ee5a798c8c2e0
MD5 1c562d88b247e1e128f710546d377b75
BLAKE2b-256 b81af1a21d24357b9f760e791c7b54804535421de1f1ee08a456d3a7f7ec7bbb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.8.1-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 0d6f7e36a94c36a9cf70af46a5ce791b04071c4ce8dde85770c61d6e14a253f9
MD5 0bc09e5a2372fd048d4e76232c58de6b
BLAKE2b-256 d4a0e6a6becc1f7dd3740373860a275c47414776ce0ac1a5672fb61ef55e29f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.8.1-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 b0928f44117e425943ee33c538d0014033ec8c0c772d76cee9297768083b13f0
MD5 b0899ae6be4dd66365e31d83d455df7d
BLAKE2b-256 e10242bd2540c021791bb49813501bb17270a53b54e3eec7e1cc20ced3d93404

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.8.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 114a866fef1578f6afda46873fc79fb35c037802aaf93239a18b7bf04286eff8
MD5 5ed5a4cf04b4717ea6903a217fc57e36
BLAKE2b-256 c5ee648592dba082791ea1f5f36bed9ea9abb309f576cb23f7a1cec1d9c04739

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.8.1-cp39-cp39-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 95e1a95b0cfa9e8e9e487a108a303d48a2fff4350bf9879909a8bdadeec502da
MD5 8c976655c2167d8da139f941d19ab1d1
BLAKE2b-256 0c4262e7826756ea043da02c0a1a5a48fc347104802e00cf80ab707f0028ba49

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.8.1-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 ecbe04786e722ffd95180c9abd9186f1c24f910b49ee3578d91bc3b7754b2941
MD5 480669fbc19242dea7465f88d2369c43
BLAKE2b-256 8910fe31ba691acbe22396c87f88a58fda1bff811cf007d4a307a08f4f02e79b

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