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

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.0rc0-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.0rc0-cp311-cp311-macosx_13_0_arm64.whl (11.3 MB view details)

Uploaded CPython 3.11 macOS 13.0+ ARM64

tensorflow_decision_forests-1.6.0rc0-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.0rc0-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.0rc0-cp310-cp310-macosx_12_0_arm64.whl (11.3 MB view details)

Uploaded CPython 3.10 macOS 12.0+ ARM64

tensorflow_decision_forests-1.6.0rc0-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.0rc0-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.0rc0-cp39-cp39-macosx_12_0_arm64.whl (11.3 MB view details)

Uploaded CPython 3.9 macOS 12.0+ ARM64

tensorflow_decision_forests-1.6.0rc0-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.0rc0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.6.0rc0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d68fca0fbe271ed07a7880fad8888fd07652e6c68844b89669e5ca042ddcdb16
MD5 ed925b04d8c0be1671937e0a35bf9716
BLAKE2b-256 16fe76d69234c1feda9e4a4c805ba3dd7d37755bed65efa1721f2a51f385172b

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-1.6.0rc0-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.6.0rc0-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 204629db1ca9fb1a4f1a2c5a58490f280e0d7b350012ff9d0523f5744abd0e14
MD5 afd8e34e47961a34cd0c7c3f577cfe94
BLAKE2b-256 a37bbae7375044d367f2983721e8b422d147e38e306d4b3d169c16a6bcc30316

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.6.0rc0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 bfb22d6b5189ec3e2c70f7a85b43e0325afe1c910daa6bedb258106179123710
MD5 d8973221a90c93eab21ec9620874a7e2
BLAKE2b-256 e9ba8734b5d5f09dcbf8cc89f57ce916c8eeeb117737679b1e93b0c20b60543a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.6.0rc0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e909b489869551faab008aff81b1733b00b4a227c092deb6b4170c75d833bac8
MD5 893f9ceaf55e704bc87a584d66d7cb09
BLAKE2b-256 77cdd26f8f96657c4e4161a8f605e53173d68cbdcc2eb070c7156e6a1428a054

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.6.0rc0-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 5cb09f9652f66ec9de0d5ad1a0ce5f96e8471efc1bf1bc9b056bd475afbb1faa
MD5 a70425a376250923b6a3ac5d234e508e
BLAKE2b-256 0aabfbb997ff8a6df9b9fd80f147925ba26256b5021a479f2444d5ba8f829ed8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.6.0rc0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 7022faa9adda8a20a7091ce0bff526e43969661264ca9d213c78fdf51df5a7f4
MD5 6aa31739b301ee309a32a03aca0efba8
BLAKE2b-256 58529b6fc5bf565e2842f08458e4b1a4dd8e665cb2ab9f427fc6b8296246bc59

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.6.0rc0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5705c8b88c47b2fa474ef10aafde59596afa03e2bcb18e9324c355142fa3fc52
MD5 517edb4aa5d2d075529fcf0d7559db95
BLAKE2b-256 1212287aeea57b83779118c870ecf42d3fb4ed1df946a0eddfbb53475c841cb2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.6.0rc0-cp39-cp39-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 1b92a8fc5938058c917c5ee766a9fdb66087f7aec5a16fda982a29a61d135a5e
MD5 1c580ddb513fe61e81c15808b8fe0222
BLAKE2b-256 de4a154603b61dcd4516dd6340d7a62692725e533e88e3dc43caccd433f5694e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.6.0rc0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 bbe1fb72de541a16ac98ef340d6484a0628bec758182a11b79fa1d85674881b0
MD5 88461abdd0f5c63707935c006f4043b4
BLAKE2b-256 421ef8a91167b3bba0aa1c1c6b8c83d3cd14a646a7c5180504ba1f834b73fa14

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