Skip to main content

YDF (short for Yggdrasil Decision Forests) is a library for training, serving, evaluating and analyzing decision forest models such as Random Forest and Gradient Boosted Trees.

Project description

Port of Yggdrasil / TensorFlow Decision Forests for Python

The Python port of Yggdrasil Decision is a light-weight wrapper around Yggdrasil Decision Forests. It allows direct, fast access to YDF's methods and it also offers advanced import / export, evaluation and inspection methods. While the package is called YDF, the wrapping code is sometimes lovingly called PYDF.

YDF is the successor of Tensorflow Decision Forests (TF-DF). TF-DF is still maintained, but new projects should choose YDF for improved performance, better model quality and more features.

Installation

To install YDF, in Python, simply grab the package from pip:

pip install ydf

For build instructions, see INSTALLATION.md.

Usage Example

import ydf
import pandas as pd

ds_path = "https://raw.githubusercontent.com/google/yggdrasil-decision-forests/main/yggdrasil_decision_forests/test_data/dataset"
train_ds = pd.read_csv(f"{ds_path}/adult_train.csv")
test_ds = pd.read_csv(f"{ds_path}/adult_test.csv")

model = ydf.GradientBoostedTreesLearner(label="income").train(train_ds)

print(model.evaluate(test_ds))

model.save("my_model")

loaded_model = ydf.load_model("my_model")

Frequently Asked Questions

See the FAQ in the documentation.

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

ydf-0.12.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

ydf-0.12.0-cp313-cp313-macosx_12_0_arm64.whl (9.0 MB view details)

Uploaded CPython 3.13macOS 12.0+ ARM64

ydf-0.12.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

ydf-0.12.0-cp312-cp312-macosx_12_0_arm64.whl (9.0 MB view details)

Uploaded CPython 3.12macOS 12.0+ ARM64

ydf-0.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

ydf-0.12.0-cp311-cp311-macosx_12_0_arm64.whl (8.9 MB view details)

Uploaded CPython 3.11macOS 12.0+ ARM64

ydf-0.12.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

ydf-0.12.0-cp310-cp310-macosx_12_0_arm64.whl (8.9 MB view details)

Uploaded CPython 3.10macOS 12.0+ ARM64

ydf-0.12.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

ydf-0.12.0-cp39-cp39-macosx_12_0_arm64.whl (8.9 MB view details)

Uploaded CPython 3.9macOS 12.0+ ARM64

ydf-0.12.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

ydf-0.12.0-cp38-cp38-macosx_12_0_arm64.whl (8.9 MB view details)

Uploaded CPython 3.8macOS 12.0+ ARM64

File details

Details for the file ydf-0.12.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ydf-0.12.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bde5322bc326d39d22ff1e519b8db5b9299340e0ae086fabcd16e91f10e326ca
MD5 cd64c6c85febe8b5c8d06ae357cd5ace
BLAKE2b-256 46f27d499d6a6e24711ad59b202cc6a2a68d56214c211e2eddc0ee93af2e13e0

See more details on using hashes here.

File details

Details for the file ydf-0.12.0-cp313-cp313-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for ydf-0.12.0-cp313-cp313-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 e9f3acfdb944c6d6cb8238c6461405ce054cf4dd4e2dea950117ba0436242a7b
MD5 b0ea904451f447da9243ab187719a538
BLAKE2b-256 9d37bb8fa49e656fb180e0de03885f99749543de20bf6030ce77b8670cacad93

See more details on using hashes here.

File details

Details for the file ydf-0.12.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ydf-0.12.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f673d47e285f830f591d085ad73f66611c09b14681b2aaf4ac86ac841da7bc73
MD5 872be33329ca3d2f63708e3879cc4b3d
BLAKE2b-256 0151de3f5bd3958ae3fb7806a67e137d254ba71994a66aac1ca8da44d87e134b

See more details on using hashes here.

File details

Details for the file ydf-0.12.0-cp312-cp312-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for ydf-0.12.0-cp312-cp312-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 5dda457e724ff8319053a73c921757852338e0707daab16f6a831aefaac231c8
MD5 18ea8e8d8c1f81428d85fa7cd12f4fea
BLAKE2b-256 d8014a92e12d4e53d48eb292dee580cc5fd4bacd502138e622fcd38584260c8c

See more details on using hashes here.

File details

Details for the file ydf-0.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ydf-0.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bd860794d775703b48b25e3c80fa4947439a2e19d5eab6dda456dc44fd3f9d48
MD5 2574377eff628339e7c8e80957eeaa7d
BLAKE2b-256 1e4c621063d30bfc4ca83acb952394e51cb2e0de3e43eaa966777c71edb47d56

See more details on using hashes here.

File details

Details for the file ydf-0.12.0-cp311-cp311-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for ydf-0.12.0-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 11e7654dba57c0a763f17e7e830b85ddedbdbd7fb3807725849cde4e204ba9a1
MD5 bc7087b24051f74fd9ec8b34eb1bb3ad
BLAKE2b-256 1f478de1be91e4caae47e31f7597ed1aa30fdd93f659644e5a01f95ffdbead0c

See more details on using hashes here.

File details

Details for the file ydf-0.12.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ydf-0.12.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 afc7be1213752512d70b000e5f6c458520e66d3b3bb2631336b27bfb4a3900de
MD5 826064b94ab96edfa4735bf5137fdc50
BLAKE2b-256 ebbe6fa48da1ad44347cabf15c77559910dbe0dee5442762c6d989e5b6f7f1d0

See more details on using hashes here.

File details

Details for the file ydf-0.12.0-cp310-cp310-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for ydf-0.12.0-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 a43a2dd4f63234741bddcf11d9b82b5f042c97249415a16abee561ffeda7ad67
MD5 ddf0d2322d9f7d9c1a4440d16d196779
BLAKE2b-256 fd61ae54df8fe2ce8550bdcbfc0aa239fc61ede513ed47c9e4bb607b81413ed4

See more details on using hashes here.

File details

Details for the file ydf-0.12.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ydf-0.12.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a11f7882f8310de26bd014b900ab4cebf10b7a3f0ed4129859606e6eabfc03ae
MD5 c16aef708d3f6790958208c0279e14cb
BLAKE2b-256 27464dd59d3fcfedcf64b47395f5af46891b44071d9d2af8098a603606b5d80a

See more details on using hashes here.

File details

Details for the file ydf-0.12.0-cp39-cp39-macosx_12_0_arm64.whl.

File metadata

  • Download URL: ydf-0.12.0-cp39-cp39-macosx_12_0_arm64.whl
  • Upload date:
  • Size: 8.9 MB
  • Tags: CPython 3.9, macOS 12.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ydf-0.12.0-cp39-cp39-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 ff2b7024e03c0742bdc8be8b9eba725e00444e13dd2a75cdee3c15d96a285ee4
MD5 93233a5b30a39d09f30719283bd6a106
BLAKE2b-256 be7bbfd04e69ab281542695ddf70d89a7d28a5277a4a4a3521d80dee9b93ea5d

See more details on using hashes here.

File details

Details for the file ydf-0.12.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ydf-0.12.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bee24ff0e0a5e047d547300b61d2192b26119a8a0206ddeddae64037889c79dd
MD5 831e526f0b2a6b124d4cb38c69dc2c91
BLAKE2b-256 73142ce2daeccb34dd097f6ae9dcb48f33db9de52fb38fc515e608ff6378972b

See more details on using hashes here.

File details

Details for the file ydf-0.12.0-cp38-cp38-macosx_12_0_arm64.whl.

File metadata

  • Download URL: ydf-0.12.0-cp38-cp38-macosx_12_0_arm64.whl
  • Upload date:
  • Size: 8.9 MB
  • Tags: CPython 3.8, macOS 12.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ydf-0.12.0-cp38-cp38-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 f781aa3805038a11e0754e7d7a00c07ebabd77d2bf044e5817fdb0b3a8a6ec4f
MD5 2fe472b6b223b3ddfc1f7c983f2c61f2
BLAKE2b-256 6132eb26408617332ade673576f243183c8d19836447e1464027b558098e5952

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page