--- id: tensorflow-decision-forests version: "1.12.0" license: Apache 2.0 license_treatment: permissive maintenance: active --- # tensorflow-decision-forests — Collection of training and inference decision forest algorithms. License: permissive · Maintenance: active · Downloads: 555.2K/mo ## 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 above — 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 pip install tensorflow-decision-forests uv add tensorflow-decision-forests 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_current - Install friction: medium - Maintenance: active - Downloads: 555.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags random forest tensorflow, gradient boosted trees python, decision forest training, tensorflow tree models, ensemble learning tensorflow, xgboost alternative tensorflow, tree-based ml models, decision-forests, ensemble-learning, tensorflow-integration [View on SkillFed](https://skillfed.io/packages/tensorflow-decision-forests) · [View on PyPI](https://pypi.org/project/tensorflow-decision-forests/)