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

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

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

tensorflow_decision_forests-1.2.0-cp310-cp310-macosx_12_0_arm64.whl (11.0 MB view details)

Uploaded CPython 3.10 macOS 12.0+ ARM64

tensorflow_decision_forests-1.2.0-cp310-cp310-macosx_10_14_x86_64.whl (29.6 MB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

tensorflow_decision_forests-1.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.5 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

tensorflow_decision_forests-1.2.0-cp39-cp39-macosx_12_0_arm64.whl (11.0 MB view details)

Uploaded CPython 3.9 macOS 12.0+ ARM64

tensorflow_decision_forests-1.2.0-cp39-cp39-macosx_10_14_x86_64.whl (29.6 MB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

tensorflow_decision_forests-1.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.5 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

tensorflow_decision_forests-1.2.0-cp38-cp38-macosx_12_0_arm64.whl (11.0 MB view details)

Uploaded CPython 3.8 macOS 12.0+ ARM64

tensorflow_decision_forests-1.2.0-cp38-cp38-macosx_10_14_x86_64.whl (29.6 MB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

tensorflow_decision_forests-1.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.5 MB view details)

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

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f171a7c99e86e9f8821b181e721ef35e8e07dd463dba6b3186dd2da563863c06
MD5 8602f270d0e136dc203d6659f3fde08f
BLAKE2b-256 62e3331cb1e4b1d4f01fe427f3bcae1e3f9bfec21701b8d5320f821bc4f94092

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.2.0-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 ad2e5bb274aed6a6bb1cdbf898f2f691fc024af0a6b41bd13fdf4979a0ee5a23
MD5 a502a0e0307f7cdbc1097447307b72ad
BLAKE2b-256 b8847e2039c8c14914d3b65f3c998dc96944450934e0a87f73c483a7a567e9f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.2.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 70bd1c438188f76e45bbd0fe6c010a09f4b850108dfee1533a46c332be11c653
MD5 dc8941e6406c3131efddd75cb5050596
BLAKE2b-256 cea278b150933159b9ac6ad7110ee264a587537c1fb46d554eb0ff03c49e19fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b8b584b679132f6a51f5fcb99c277fd3a9860d727f4676e3994addacd16bd160
MD5 a6e1b0caa84f80aae9113772a7f4e509
BLAKE2b-256 3e2da368f453d78f4084052218aff04fbaf8642bfc38c064d6e10c851d8e4325

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.2.0-cp39-cp39-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 5c55059085e4f2a1fa10f22b6cc38dabad35bc21d1c32623fe4c412abfc5e392
MD5 49e13fbf902ed0989e580f5cf289a691
BLAKE2b-256 0d723ececf5d4b1e496b58fced94b1ee4a6edbf7d34e375ab194e6772416d30f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.2.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 ea9aedea2f502eec6a3c2dc7c8be222c6fa6b36426b3142bfa4192bccecb858e
MD5 57b7b859d09dd702ee3b64610f8585fe
BLAKE2b-256 fbc283aeae8e6d9b9114448224264066c3d2409bd535f641d2e7242aba6f9d68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 00d4dec81ae3f898075dee746ba28aad54a06014ef524369e009500132255430
MD5 44f4041c0925d714c8cb3ed0d283a00c
BLAKE2b-256 962794facdcc62edd9539e18179cccb6c27dbd07a4d9b83b52474248c7f488b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.2.0-cp38-cp38-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 9e80ed711e99465c2873302475a2fb3d62b663b58b72c43bbc83ec6b476ba3b7
MD5 059ac7c9017df6c8f8c87d93b1f11abd
BLAKE2b-256 9039bd2007ef4218e227b1be0eac86f269ca42e05a5abf783606be6335a7a389

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.2.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 e4487edcde41b23c038c65364bf1f0e74ef80f2d996088471794a95a10906271
MD5 96e3d2433e3c8db3ff6ac49c620e97ce
BLAKE2b-256 36038430c71b8d7fc6b5dc2f0e2d8f97c2441264bd6d5d592966f5f3af4a0db2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 08400eb3258e09a9f3feeffc1a5b649e5ad648c9b99213ff0db88ebee5afbd93
MD5 419ae1aa291c34125b64d4e906405320
BLAKE2b-256 6dc7e70dbd8e11da70486f479a3df48c2037a030b21bd82180fe2c19e19c93f0

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