tensorflow-decision-forests
Collection of training and inference decision forest algorithms.
What it is and what it does
TensorFlow Decision Forests is a library for training and deploying decision forest models—Random Forests, Gradient Boosted Trees, and similar ensemble methods—directly within TensorFlow. It handles classification, regression, and ranking problems, and is powered by Yggdrasil Decision Forests, a C++ backend that also supports JavaScript, CLI, and Go. Models trained in TensorFlow Decision Forests can be exported as TensorFlow SavedModels and are compatible with Yggdrasil models.
The library integrates with TensorFlow's Keras API, accepting pandas DataFrames or TensorFlow datasets as input. It provides model inspection, evaluation, and export capabilities. It runs on Linux and macOS (Windows via WSL). The package depends on TensorFlow, pandas, numpy, and several other utilities, making it suitable for teams already working within the TensorFlow ecosystem who want tree-based models alongside neural networks.
Use it for:
- Train Random Forest or Gradient Boosted Tree models on tabular data using TensorFlow's Keras API and pandas DataFrames.
- Build classification or regression pipelines that combine decision forests with TensorFlow's preprocessing and deployment infrastructure.
- Export trained models as TensorFlow SavedModels for serving in production environments or converting to Yggdrasil format.
- Interpret model predictions through decision forest-specific analysis tools available in the library.
- Migrate or interoperate between TensorFlow Decision Forests and Yggdrasil Decision Forests across different platforms.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Trains and deploys decision forest models (Random Forests, Gradient Boosted Trees) within TensorFlow for classification, regression, and ranking tasks.
Yes, if you are already using TensorFlow and need tree-based models. The library is actively maintained, has no known vulnerabilities, and integrates cleanly with TensorFlow's ecosystem. Medium install friction is acceptable for a compiled package. Not recommended for Windows users without WSL, or for projects not already committed to TensorFlow.
Install
tensorflow-decision-forests on PyPI
pip
pip install tensorflow-decision-forestsuv
uv add tensorflow-decision-forestspoetry
poetry add tensorflow-decision-forestsInstalling tensorflow-decision-forests
Before you install
Medium install friction due to compiled dependencies and platform-specific wheels. Active maintenance with recent commits and no known vulnerabilities. Requires TensorFlow and nine runtime dependencies including numpy, pandas, and ydf.
License in practice
Apache 2.0 permissive license allows commercial and private use with minimal restrictions; you must include a copy of the license and state significant changes.
Quickstart
pip install tensorflow_decision_forests
import tensorflow_decision_forests as tfdf
import pandas as pd
train_df = pd.read_csv("train.csv")
train_ds = tfdf.keras.pd_dataframe_to_tf_dataset(train_df, label="my_label")
model = tfdf.keras.RandomForestModel()
model.fit(train_ds)
Requires TensorFlow installed; available on Linux and macOS only (Windows users must use WSL+Linux).
Verify before relying
- Whether the nine runtime dependencies (numpy, pandas, tensorflow, six, absl_py, wheel, wurlitzer, tf_keras, ydf) are all required or some are optional.
- Performance characteristics compared to other decision forest libraries when handling large datasets.
- Exact compatibility scope with Yggdrasil Decision Forest models beyond what the description states.
Package facts
| License | Apache 2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 9 — numpy, pandas, tensorflow, six, absl_py, wheel, wurlitzer, tf_keras, ydf |
| Maintenance | actively maintained — 519 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 555,172/month — #6,028 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: tensorflow_decision_forests-1.12.0-cp310-cp310-macosx_12_0_arm64.whl; tensorflow_decision_forests-1.12.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; tensorflow_decision_forests-1.12.0-cp311-cp311-macosx_12_0_arm64.whl; tensorflow_decision_forests-1.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; tensorflow_decision_forests-1.12.0-cp312-cp312-macosx_12_0_arm64.whl; tensorflow_decision_forests-1.12.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; tensorflow_decision_forests-1.12.0-cp39-cp39-macosx_12_0_arm64.whl; tensorflow_decision_forests-1.12.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Keywords: tensorflow, tensor, machine, learning, decision, forests, random, forest, gradient, boosted, decision, trees
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
dtreevizdtreeviz renders decision trees from…
permissive · top 15,000 on PyPI
ydfYDF trains, evaluates, and interprets decision…
permissive · top 15,000 on PyPI
treeliteTreelite serializes and exchanges decision tree…
permissive · top 15,000 on PyPI
py_treespy_trees implements behaviour trees in Python,…
permissive · top 15,000 on PyPI
quantile-forestQuantile regression forests for estimating…
permissive · top 15,000 on PyPI
treelite-runtimeTreelite-runtime provides a Python runtime for…
permissive · top 15,000 on PyPI
forestciComputes confidence intervals and variance…
permissive · top 15,000 on PyPI
xgboost-cpuXGBoost CPU-only gradient boosting library for…
permissive · top 15,000 on PyPI
treeinterpreterDecomposes scikit-learn decision tree and…
permissive · top 15,000 on PyPI
xgboostXGBoost is a gradient boosting library that…
permissive · top 1,000 on PyPI