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.4-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (13.4 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

tensorflow_decision_forests-0.2.4-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.4-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (13.4 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

tensorflow_decision_forests-0.2.4-cp38-cp38-macosx_12_0_x86_64.whl (11.3 MB view details)

Uploaded CPython 3.8 macOS 12.0+ x86-64

tensorflow_decision_forests-0.2.4-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (13.4 MB view details)

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

tensorflow_decision_forests-0.2.4-cp37-cp37m-macosx_12_0_x86_64.whl (11.3 MB view details)

Uploaded CPython 3.7m macOS 12.0+ x86-64

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-0.2.4-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 af38b60289efbaf634b962e8c1f89c89d67337a60cda005d568d2ba71580bb89
MD5 96753875981358153581576e5292f428
BLAKE2b-256 ec4f1608e7f48231540e18cb47536dc07e53eb949f7c67fc3a2becb3e1b72fb5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-0.2.4-cp39-cp39-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 5f3437c894e78f90229f5448cd570b1b5a74a856d64189d1dcf93f1c894410de
MD5 18abe28a049f85d0cf6de2f23e2fcbf5
BLAKE2b-256 f87226f35947eca7df4477f29d3edebd8ffc93566a221b6b6aa438aed7cff3c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-0.2.4-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 5f04404fc169ab601de9d3da1070224273413f846aa9781573dd4617a806a8fc
MD5 7d10d41e4dc3d0ab473011ce2a618239
BLAKE2b-256 44eec656362a536d2afebeb9518e793b9b29dbb17b38678a18d1a4d64870fa7b

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-0.2.4-cp38-cp38-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-0.2.4-cp38-cp38-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 b2827e79914bddc0dabf20af8593bd79c5cf8f56b9306ce2890270197d8e6322
MD5 3fc29f61bffe0e6db7b5991d33550a53
BLAKE2b-256 b4093a19e5544fe374e8e9f1ebec187c1bbe4d1e22bad965d1b6c2da6287eead

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-0.2.4-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 ebfe4649b8a3d97e61cc73275f405af4be3a986855416cc127dec9f01be8e350
MD5 93f16621378bad53e934ff306ac093e6
BLAKE2b-256 35f67186cc9d18c61113cb5eb827e95d6030430e7fd593aefd2da6fdc7357348

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-0.2.4-cp37-cp37m-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-0.2.4-cp37-cp37m-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 8ae624e730509902929a218410e7f5a0b0f42695df32de47ead9d5f1915c82a3
MD5 3a2580e13c641a621c87d7d043301a75
BLAKE2b-256 4f98e668719faa83c1a7ed2d759da65bc27b647fee3ae04f827d712abd5d7a62

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