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 IO Presentation

<iframe width="560" height="315" src="https://www.youtube.com/embed/5qgk9QJ4rdQ" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

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.

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.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.2 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

tensorflow_decision_forests-1.1.0-cp310-cp310-macosx_12_0_arm64.whl (10.8 MB view details)

Uploaded CPython 3.10 macOS 12.0+ ARM64

tensorflow_decision_forests-1.1.0-cp310-cp310-macosx_10_14_x86_64.whl (11.9 MB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

tensorflow_decision_forests-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.2 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

tensorflow_decision_forests-1.1.0-cp39-cp39-macosx_12_0_arm64.whl (10.8 MB view details)

Uploaded CPython 3.9 macOS 12.0+ ARM64

tensorflow_decision_forests-1.1.0-cp39-cp39-macosx_10_14_x86_64.whl (11.9 MB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

tensorflow_decision_forests-1.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.2 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

tensorflow_decision_forests-1.1.0-cp38-cp38-macosx_12_0_arm64.whl (10.8 MB view details)

Uploaded CPython 3.8 macOS 12.0+ ARM64

tensorflow_decision_forests-1.1.0-cp38-cp38-macosx_10_14_x86_64.whl (11.9 MB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

tensorflow_decision_forests-1.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.2 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 54c7523b1961ec165d0615d13ce9262f749ceaeb226f6a53bba0b8fcc3683eae
MD5 e5f4e38c153bd14b51eeda83958f86d2
BLAKE2b-256 f3375317df8a743e9b910b2146fb0963f49e0b1e8d8be7581878059b41ead5bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.1.0-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 f7714787d8d31f3ec852e6da589317f109b8d5d7296dad7177e30af836ed3e09
MD5 74afd06d66203c0dc61b3408a702258b
BLAKE2b-256 72ff887f7551e1df2fefcb45fecf7772ceaedae826ac2a74277f0c33666e271e

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-1.1.0-cp310-cp310-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.1.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 f492dc08bec82f1801dfb6ad8ef38cb2fbb85c53b458967093f6ecf60088c1b6
MD5 8ba3db3cad1c52ea83c57dfbd39ac42a
BLAKE2b-256 a0b4546d4e82bb71d1c014d82fcac798f888637c6060d79fb9aa32e2581d50ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8f9a0b054da25fc82515a6e6dcd16d74076d772984a0464ade24c7d297152460
MD5 f13c989fb789cfadf5336526f2b10b81
BLAKE2b-256 ddaa00af58218a3810d7e1bb73fd6acb60d3f87f8ef9660b4d350c24da4067de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.1.0-cp39-cp39-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 a7506140a1bc2ad22f9d33761495f99804296ee59027175b759c0ffeceb91582
MD5 a63d990061bfca7ef9fba952f61cd4bc
BLAKE2b-256 557eacae49304dc11523e4428cf3a88ddc8018cecd44cbe4b152ccc71cc0ee38

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-1.1.0-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.1.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 94c97326e34916f7ec5180017796f496e2578fb3582a0678f4c8fcadc5782501
MD5 fa6aced95eacdd803f7a67d8fb696ac2
BLAKE2b-256 9637b6e44d47f08e5e44ff91b19834e28624b18ba19eaa43e07d1a88fa04f9dd

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-1.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2f22231b11ec0f46678e4e4692a756bfd43904065fcb77ec874de24698a85832
MD5 636104e889e5903cf10dd030092abfd5
BLAKE2b-256 8cf1de7f6d99730435d2a00e41f73a96a8827048a1a8ced70cca5b5b4c7c90a3

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-1.1.0-cp38-cp38-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.1.0-cp38-cp38-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 946b42568d486a982038af068ec56d17f485dcf1f456b60cf981f896f467d81b
MD5 e89565ac668ce64336d42c656320af56
BLAKE2b-256 b527f729662d3b4614b85f216a7414ce944d6ee3e8702c8d382fec525280da57

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-1.1.0-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.1.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 ae2acb75b3d96a4886d30990cb044ebb42f8141dbf4e438f485af0b1c4f60da6
MD5 2b8b9609f389e0dfdd1edd592801bca6
BLAKE2b-256 34edf4a5b7dc831b791bd6ca34d4e98fa09eb08c7caf91564a76cf433b10621b

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-1.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c3107b35613677ae5ed91394f1a7f9f0a15526c4efe66125a0acc9133205f4b8
MD5 f52cf78402e6cdcb5b545413313443c1
BLAKE2b-256 c389d94f0270134b6f9ddc99d84a0c9b937f74023904c9c3c190174b7dc8104f

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