# 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](https://github.com/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
```python
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)
Raw data
{
"_id": null,
"home_page": "https://github.com/google/yggdrasil-decision-forests",
"name": "ydf",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "machine learning decision forests random forest gradient boosted decision trees classification regression ranking uplift",
"author": "Mathieu Guillame-Bert, Richard Stotz, Jan Pfeifer",
"author_email": "decision-forests-contact@google.com",
"download_url": null,
"platform": null,
"description": "# Port of Yggdrasil / TensorFlow Decision Forests for Python\n\nThe Python port of Yggdrasil Decision is a light-weight wrapper around Yggdrasil\nDecision Forests. It allows direct, fast access to YDF's methods and it also\noffers advanced import / export, evaluation and inspection methods. While the\npackage is called YDF, the wrapping code is sometimes lovingly called *PYDF*.\n\nIt is not a replacement for its sister project \n[Tensorflow Decision Forests](https://github.com/tensorflow/decision-forests) \n(TF-DF). Instead, it complements TF-DF for use cases that cannot be solved \nthrough the Keras API.\n\n## Installation\n\nTo install YDF, in Python, simply grab the package from pip:\n\n```\npip install ydf\n```\n\nFor build instructions, see INSTALLATION.md.\n\n## Usage Example\n\n```python\nimport ydf\nimport pandas as pd\n\nds_path = \"https://raw.githubusercontent.com/google/yggdrasil-decision-forests/main/yggdrasil_decision_forests/test_data/dataset\"\ntrain_ds = pd.read_csv(f\"{ds_path}/adult_train.csv\")\ntest_ds = pd.read_csv(f\"{ds_path}/adult_test.csv\")\n\nmodel = ydf.GradientBoostedTreesLearner(label=\"income\").train(train_ds)\n\nprint(model.evaluate(test_ds))\n\nmodel.save(\"my_model\")\n\nloaded_model = ydf.load_model(\"my_model\")\n```\n\n## Frequently Asked Questions\n\n* **Is it PYDF or YDF?** The name of the library is simply ydf, and so is the\n name of the corresponding Pip package. Internally, the team sometimes uses\n the name *PYDF* because it fits so well.\n* **What is the status of PYDF?** PYDF is currently in Alpha development. Most\n parts already work well (training, evaluation, predicting, export), some new\n features are yet to come. The API surface is mostly stable but may still \n change without notice.\n* **Where is the documentation for PYDF?** The documentation is\n available on https://ydf.readthedocs.org.\n* **How should I pronounce PYDF?** The preferred pronunciation is \n \"Py-dee-eff\" / \u02c8pa\u026a\u02c8di\u02c8\u025bf (IPA)\n\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "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.",
"version": "0.4.2",
"project_urls": {
"Documentation": "https://ydf.readthedocs.io/",
"Homepage": "https://github.com/google/yggdrasil-decision-forests",
"Source": "https://github.com/google/yggdrasil-decision-forests.git",
"Tracker": "https://github.com/google/yggdrasil-decision-forests/issues"
},
"split_keywords": [
"machine",
"learning",
"decision",
"forests",
"random",
"forest",
"gradient",
"boosted",
"decision",
"trees",
"classification",
"regression",
"ranking",
"uplift"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5ac9d57443e32ce0d3be75ff68e87b106c88c39bc7c7262d7764ded78fa5f56f",
"md5": "6ba9e2a95f75d34b8124ab7510fc82f4",
"sha256": "3c252c0a90b9bccc1f73c2f0a4c2ebbcb68c236de8c8f51e192832b2abe532e2"
},
"downloads": -1,
"filename": "ydf-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "6ba9e2a95f75d34b8124ab7510fc82f4",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 9141580,
"upload_time": "2024-04-22T16:18:21",
"upload_time_iso_8601": "2024-04-22T16:18:21.146446Z",
"url": "https://files.pythonhosted.org/packages/5a/c9/d57443e32ce0d3be75ff68e87b106c88c39bc7c7262d7764ded78fa5f56f/ydf-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6d5951a991bbbac2d3d5de43c7c55ba351a9193438466fa64e40cc2bf96a1584",
"md5": "2524666c6289e091325fa85d894c8620",
"sha256": "a7a27e46ab3eb56097c944a1c7b800d811dfeeaa847532a1979f8b87e188be9f"
},
"downloads": -1,
"filename": "ydf-0.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "2524666c6289e091325fa85d894c8620",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 9141812,
"upload_time": "2024-04-22T16:18:25",
"upload_time_iso_8601": "2024-04-22T16:18:25.457180Z",
"url": "https://files.pythonhosted.org/packages/6d/59/51a991bbbac2d3d5de43c7c55ba351a9193438466fa64e40cc2bf96a1584/ydf-0.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "07b95eb36d5105d3acb532fabf25e52c950f194594edf02b86aef41a577bec8a",
"md5": "a9d0408680328aafb5c60cbd84ac4c30",
"sha256": "0a4bd0f2d901806001779d06ed527b0168f410404680d60d801ec5cd77051893"
},
"downloads": -1,
"filename": "ydf-0.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "a9d0408680328aafb5c60cbd84ac4c30",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 9141386,
"upload_time": "2024-04-22T16:18:29",
"upload_time_iso_8601": "2024-04-22T16:18:29.209021Z",
"url": "https://files.pythonhosted.org/packages/07/b9/5eb36d5105d3acb532fabf25e52c950f194594edf02b86aef41a577bec8a/ydf-0.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5bafe73cb3cfa216aaac86cb2d1eed9313e5d72a504c4146dfc7971a5805f90f",
"md5": "afde615ce4fc416104badb8a2c9d59ef",
"sha256": "05ac28bde29bcf4bc6812b7ddc29616739b7fea71f64c6238d52fca960893e57"
},
"downloads": -1,
"filename": "ydf-0.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "afde615ce4fc416104badb8a2c9d59ef",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 9144427,
"upload_time": "2024-04-22T16:18:33",
"upload_time_iso_8601": "2024-04-22T16:18:33.181832Z",
"url": "https://files.pythonhosted.org/packages/5b/af/e73cb3cfa216aaac86cb2d1eed9313e5d72a504c4146dfc7971a5805f90f/ydf-0.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-22 16:18:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "google",
"github_project": "yggdrasil-decision-forests",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "ydf"
}