Skip to main content

Collection of training and inference decision forest algorithms.

Project description

TensorFlow Decision Forests

TensorFlow

TensorFlow Decision Forests (TF-DF) is a collection of state-of-the-art algorithms for the training, serving and interpretation of Decision Forest models. The library is a collection of Keras models and supports classification, regression and ranking.

TF-DF is a TensorFlow wrapper around the Yggdrasil Decision Forests C++ libraries. Models trained with TF-DF are compatible with Yggdrasil Decision Forests' models, and vice versa. This link explains how to do inference of TF-DF models in C++ using Yggdrasil.

Usage example

A minimal end-to-end run looks as follow:

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")

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)
  • 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-0.2.3-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (13.3 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

tensorflow_decision_forests-0.2.3-cp39-cp39-macosx_12_0_x86_64.whl (11.3 MB view details)

Uploaded CPython 3.9 macOS 12.0+ x86-64

tensorflow_decision_forests-0.2.3-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (13.3 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

tensorflow_decision_forests-0.2.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (13.3 MB view details)

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

File details

Details for the file tensorflow_decision_forests-0.2.3-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-0.2.3-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 6370dfd335cb80912d521f6c9a1362429e97851e9261faa9315094f4eec9d60b
MD5 7ec0b757e348534b13940a29db972981
BLAKE2b-256 08b5ff088e886c69d180c2cf7306e67a8d0a7fed92e0234248f067a9dddf1da3

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-0.2.3-cp39-cp39-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-0.2.3-cp39-cp39-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 278619601bd41765dc98b409997f4bf6f6263836e9497f13e8facef481ae993e
MD5 7c23e305b2bdaf38f37472a334af0b74
BLAKE2b-256 68f9a8138bb5334abcce62fc2e333b921931d926440eed8a6369d6e55da64d0b

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-0.2.3-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-0.2.3-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 bf06a009a65887ae125bca114bf1e2a380c12df9c35d4ed312dcaf266e8225eb
MD5 11e47214dc92401080d4c6f8ceb83a9d
BLAKE2b-256 4bdb936c8174cfb9f8a01ec37e6cea2fbb8f60e5c7d2de6ce19246189dcebe20

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-0.2.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-0.2.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 67719909791f48b5a3ba5d16bc2ff31b5702329621e4493ae1ce4c9f213e68af
MD5 10b6c0533c4cb2009b370b54b1a5eec2
BLAKE2b-256 adf974bb2847617d295918f9b446bc605984bc40a5c22839ffff36d2dd2942f9

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