skillfed

tensorflow-decision-forests

Collection of training and inference decision forest algorithms.

tensorflow-decision-forests v1.12.0 555.2K downloads/30d#6,028 on PyPI693
Permissive license Apache 2.0 Active released

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-forests

uv

uv add tensorflow-decision-forests

poetry

poetry add tensorflow-decision-forests

Installing 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

Intended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: MathematicsTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

random forest tensorflowgradient boosted trees pythondecision forest trainingtensorflow tree modelsensemble learning tensorflowxgboost alternative tensorflowtree-based ml models
decision-forestsensemble-learningtensorflow-integration

More Software Development packages