Socket
Socket
Sign inDemoInstall

ydf

Package Overview
Dependencies
2
Maintainers
2
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ydf

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.


Maintainers
2

Readme

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.

It is not a replacement for its sister project Tensorflow Decision Forests (TF-DF). Instead, it complements TF-DF for use cases that cannot be solved through the Keras API.

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

  • Is it PYDF or YDF? The name of the library is simply ydf, and so is the name of the corresponding Pip package. Internally, the team sometimes uses the name PYDF because it fits so well.
  • What is the status of PYDF? PYDF is currently in Alpha development. Most parts already work well (training, evaluation, predicting, export), some new features are yet to come. The API surface is mostly stable but may still change without notice.
  • Where is the documentation for PYDF? The documentation is available on https://ydf.readthedocs.org.
  • How should I pronounce PYDF? The preferred pronunciation is "Py-dee-eff" / ˈpaɪˈdiˈɛf (IPA)

Keywords

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc