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.

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.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.7 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

tensorflow_decision_forests-1.4.0-cp311-cp311-macosx_12_0_arm64.whl (10.9 MB view details)

Uploaded CPython 3.11 macOS 12.0+ ARM64

tensorflow_decision_forests-1.4.0-cp311-cp311-macosx_10_15_x86_64.whl (12.1 MB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

tensorflow_decision_forests-1.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.7 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

tensorflow_decision_forests-1.4.0-cp310-cp310-macosx_12_0_arm64.whl (10.9 MB view details)

Uploaded CPython 3.10 macOS 12.0+ ARM64

tensorflow_decision_forests-1.4.0-cp310-cp310-macosx_10_15_x86_64.whl (12.1 MB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

tensorflow_decision_forests-1.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.7 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

tensorflow_decision_forests-1.4.0-cp39-cp39-macosx_12_0_arm64.whl (10.9 MB view details)

Uploaded CPython 3.9 macOS 12.0+ ARM64

tensorflow_decision_forests-1.4.0-cp39-cp39-macosx_10_15_x86_64.whl (12.1 MB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

tensorflow_decision_forests-1.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.7 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

tensorflow_decision_forests-1.4.0-cp38-cp38-macosx_12_0_arm64.whl (10.9 MB view details)

Uploaded CPython 3.8 macOS 12.0+ ARM64

tensorflow_decision_forests-1.4.0-cp38-cp38-macosx_10_15_x86_64.whl (12.1 MB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

File details

Details for the file tensorflow_decision_forests-1.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 532b0dfef9ff3b8b5bdc038f950936735debff35ab620833e9b6ec6a0576feb7
MD5 aa2034c3c0db535c5afa95d8d6cd49a9
BLAKE2b-256 c191a4e39b639253089bef05f848999720e83ef561683c2c09185d2900c21f6d

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-1.4.0-cp311-cp311-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.4.0-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 3a74c7e26774b004a58db71af6b5cfe9f36744045da0424107da4a2fd1854d18
MD5 958b50790dc1cd19d543cd821ea82202
BLAKE2b-256 b08df03c67717ec18da75751a1f52f99d2ed748a346fb206d33f5830d7b629f8

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-1.4.0-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.4.0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 a5400aa300067a3390693889228e949393010076b6a494cac9526ade2dae8ab4
MD5 f7ed73960cca7701a0288e32fd16cdf3
BLAKE2b-256 4771b236392f62cb72066491e5edccf5f9c5a975019772602dbd385ca8e15ebf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 692c8a76ba67ebabe1f327dfd50a5841c8d7f0d21f3fb00a9098391c75061d25
MD5 4044eb3480dbb978b8cc4bb8d1aebd9f
BLAKE2b-256 8b1761320da7be20111e7a03867be2da773cb159e5fb661e2b9c3b4895f230d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.4.0-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 caffebcafa7c32e370691f14c260627b8f23c23a79d1f1fd43349409484e6cdf
MD5 70f30665694ad93fac9232a88be091ae
BLAKE2b-256 b2c4fb15b3c9fd4338f418c77338b3485fd3352e1f41863ec3c964076a210ecf

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-1.4.0-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.4.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 0e5a1d64ce9764abf406d63027ab70f1ac143950663ebdb92c8eac002fd3dfc8
MD5 34921394071dac1716565103c5c5e542
BLAKE2b-256 0b7c03eda7e4c969a77ea89c5a0d57de009afee7f5893de6b29f61cacb9c27a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dea6165e7c815e99e5483345ed61f034a27597cff015a9396858791a7fbd9597
MD5 38cc3f9d3d16fb24349f755851440abc
BLAKE2b-256 55bd1cb512e67180c8593644a5f99d2cf71a515a611e2df0268735777d26da49

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.4.0-cp39-cp39-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 43a35dbeeaf253256118350b03dd789d165d546a012661721771cf8f4e98d393
MD5 fa8d2fe0599a465b3a389e9792028de7
BLAKE2b-256 4aefcc102d55059097d6dc371b4bff74de9352f2229c29342de4867556e7f865

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-1.4.0-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.4.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 44ae6b83fa362713d80d68e6b705fcff37f4a7fdbdf341edbd4be4e4bb3272ea
MD5 42d16d16d01184e0682ed168f3dd3c5a
BLAKE2b-256 504839c4e4cd166786b85654c850af51374d3af62114daefebf6e3c4baa75ac0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 61aa3aa7167e79fc93f575f09a1089fcb3b1eece827d31d2ada3c92650e8560a
MD5 35438c0d63d201d7fbfc25f6f7dea806
BLAKE2b-256 ec82d8c4a8e36972437dc893e136317be6dbc41e19f115557804137c13a1e820

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.4.0-cp38-cp38-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 f2cafb048198836555de19468950daccb05bb3eef6c281585940697ffcabb57e
MD5 5851b76d8f6029095ffd70e0c34a4235
BLAKE2b-256 14b5ad52d2780b7536655ffe9a69c6e79007cdf6770dc60dea88b7db97f870f7

See more details on using hashes here.

File details

Details for the file tensorflow_decision_forests-1.4.0-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for tensorflow_decision_forests-1.4.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 debfe9e478a10ad12a1e6e11bdbe8813319ffe5b6935408024d9dbe4b42ed52f
MD5 8224fc4109df9813387e609a621a4730
BLAKE2b-256 487b0633d82a9a588bea7a9c7b4dcd3532f55ad0a9de92501831ac926c9805ec

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