# 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](https://github.com/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
```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
See the [FAQ](https://ydf.readthedocs.io/en/latest/faq/) in the documentation.
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\nYDF is the successor of\n[Tensorflow Decision Forests](https://github.com/tensorflow/decision-forests) \n(TF-DF). TF-DF is still maintained, but new projects should choose YDF for\nimproved performance, better model quality and more features.\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\nSee the [FAQ](https://ydf.readthedocs.io/en/latest/faq/) in the documentation.\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.10.0",
"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": null,
"digests": {
"blake2b_256": "3fb62b758d5febc450592dc65e570fdc6c073dac6b22b11f73feffd7cb20e783",
"md5": "13417493c8e57f2f9d6c5f60b46dbf8d",
"sha256": "b16728fdc9bedd706f4b1da2e1793653ee675c8bbf6fdeeb0db95737eba3a2fd"
},
"downloads": -1,
"filename": "ydf-0.10.0-cp310-cp310-macosx_12_0_arm64.whl",
"has_sig": false,
"md5_digest": "13417493c8e57f2f9d6c5f60b46dbf8d",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 7844686,
"upload_time": "2025-02-11T13:32:42",
"upload_time_iso_8601": "2025-02-11T13:32:42.322062Z",
"url": "https://files.pythonhosted.org/packages/3f/b6/2b758d5febc450592dc65e570fdc6c073dac6b22b11f73feffd7cb20e783/ydf-0.10.0-cp310-cp310-macosx_12_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d1dabdb5ae20d259f9dd84c45356974f3e8fd2e8f9554dd1bfbbda0cb36b1db5",
"md5": "88eae5c11c2df45d02c181fd0d6aa361",
"sha256": "b666c7f9b689d7d2e01688747d992039fc156818f21a47ef417d1ec0acc1bfcb"
},
"downloads": -1,
"filename": "ydf-0.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "88eae5c11c2df45d02c181fd0d6aa361",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 10571309,
"upload_time": "2025-02-11T13:32:45",
"upload_time_iso_8601": "2025-02-11T13:32:45.992956Z",
"url": "https://files.pythonhosted.org/packages/d1/da/bdb5ae20d259f9dd84c45356974f3e8fd2e8f9554dd1bfbbda0cb36b1db5/ydf-0.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "60febd89cc16c4cdd9a58300fedeb791167cca55a577e92ac74c642f5ac1ca84",
"md5": "1351e8cdf8ae4053a97c905e037b251a",
"sha256": "5f6a62d28cd3f0851d04a425f045c3a62551ac88dbfad8276bab65b32d38bdf4"
},
"downloads": -1,
"filename": "ydf-0.10.0-cp311-cp311-macosx_12_0_arm64.whl",
"has_sig": false,
"md5_digest": "1351e8cdf8ae4053a97c905e037b251a",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 7845415,
"upload_time": "2025-02-11T13:32:49",
"upload_time_iso_8601": "2025-02-11T13:32:49.438719Z",
"url": "https://files.pythonhosted.org/packages/60/fe/bd89cc16c4cdd9a58300fedeb791167cca55a577e92ac74c642f5ac1ca84/ydf-0.10.0-cp311-cp311-macosx_12_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "5d8c4c3281b8f5565e81a24780095a294e6567ece9ad13a98cdfbc15bd438f1c",
"md5": "0502cb42d9ac02bf8076b3ee67367473",
"sha256": "fb677fea6419d95c75a06107b3fe4128f32d6266484e58f46dad1387521a0b37"
},
"downloads": -1,
"filename": "ydf-0.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "0502cb42d9ac02bf8076b3ee67367473",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 10571144,
"upload_time": "2025-02-11T13:32:53",
"upload_time_iso_8601": "2025-02-11T13:32:53.185091Z",
"url": "https://files.pythonhosted.org/packages/5d/8c/4c3281b8f5565e81a24780095a294e6567ece9ad13a98cdfbc15bd438f1c/ydf-0.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "30d4fcbf3fcb1376c4f9bd2667a3355435d6b8795bf6c1e09611d0e6e074d580",
"md5": "33dcebe5477941a88448fabc9a1a1673",
"sha256": "a33697c70f18dbd47a7f1d500332ea11500fe7fccec0575e8463387e675a6fa9"
},
"downloads": -1,
"filename": "ydf-0.10.0-cp312-cp312-macosx_12_0_arm64.whl",
"has_sig": false,
"md5_digest": "33dcebe5477941a88448fabc9a1a1673",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.8",
"size": 7851142,
"upload_time": "2025-02-11T13:32:56",
"upload_time_iso_8601": "2025-02-11T13:32:56.940625Z",
"url": "https://files.pythonhosted.org/packages/30/d4/fcbf3fcb1376c4f9bd2667a3355435d6b8795bf6c1e09611d0e6e074d580/ydf-0.10.0-cp312-cp312-macosx_12_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "08ccae1a6b29c0ae910792539434567227d5032cf03773ab68a21b60e68f135b",
"md5": "2c7b9aeb66f91c637d0946f1dbe29676",
"sha256": "cf12f04a77fa909dee20971dbbc531ca9123910c40e7d3b18487d34e4c4004db"
},
"downloads": -1,
"filename": "ydf-0.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "2c7b9aeb66f91c637d0946f1dbe29676",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.8",
"size": 10570913,
"upload_time": "2025-02-11T13:32:59",
"upload_time_iso_8601": "2025-02-11T13:32:59.569432Z",
"url": "https://files.pythonhosted.org/packages/08/cc/ae1a6b29c0ae910792539434567227d5032cf03773ab68a21b60e68f135b/ydf-0.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4fd038c09217e4e3cbd6f92479d4d48d7fa4601cc51ec2aae959228a8a038528",
"md5": "6970218cf09d6a14157856a301b0d3a1",
"sha256": "dbefb278ee2fd9353febbb830ba0e57461e13119ab0d87d588e1020497ffffa3"
},
"downloads": -1,
"filename": "ydf-0.10.0-cp38-cp38-macosx_12_0_arm64.whl",
"has_sig": false,
"md5_digest": "6970218cf09d6a14157856a301b0d3a1",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 7844340,
"upload_time": "2025-02-11T13:33:03",
"upload_time_iso_8601": "2025-02-11T13:33:03.376930Z",
"url": "https://files.pythonhosted.org/packages/4f/d0/38c09217e4e3cbd6f92479d4d48d7fa4601cc51ec2aae959228a8a038528/ydf-0.10.0-cp38-cp38-macosx_12_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d28e3b5e1b6e5591d5ed7fce5c6f130b578be56f38b4d2e3c982bf425d78a4dd",
"md5": "d5d347fd68367ffcfd1710e627bed1bd",
"sha256": "7250f53e5f5e6a9d1fd23d5883a83893f1c9e626bb3fadb21d22895971e5035b"
},
"downloads": -1,
"filename": "ydf-0.10.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "d5d347fd68367ffcfd1710e627bed1bd",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 10570425,
"upload_time": "2025-02-11T13:33:07",
"upload_time_iso_8601": "2025-02-11T13:33:07.351494Z",
"url": "https://files.pythonhosted.org/packages/d2/8e/3b5e1b6e5591d5ed7fce5c6f130b578be56f38b4d2e3c982bf425d78a4dd/ydf-0.10.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "2de6539ade4483063528495ac5689ea027aefc87d403ed1f5ce527650e5d89ba",
"md5": "f20132ea9ed617fb867cda14cc3d9867",
"sha256": "31c7eb9a9c8bcddbddf41aa6b9b317c7fd000913dea7aff8869bf0dce1cdda6c"
},
"downloads": -1,
"filename": "ydf-0.10.0-cp39-cp39-macosx_12_0_arm64.whl",
"has_sig": false,
"md5_digest": "f20132ea9ed617fb867cda14cc3d9867",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 7844468,
"upload_time": "2025-02-11T13:33:11",
"upload_time_iso_8601": "2025-02-11T13:33:11.266431Z",
"url": "https://files.pythonhosted.org/packages/2d/e6/539ade4483063528495ac5689ea027aefc87d403ed1f5ce527650e5d89ba/ydf-0.10.0-cp39-cp39-macosx_12_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "725f7940c59e3a74368183c48f03666245ccb09b4c92993e990bcaa667f7e711",
"md5": "f2cbec6548087e71e8814306d608c5fd",
"sha256": "818e3f0aed9d4cb4552e72823226991bbb775bc6de5af40569fea152c3658f41"
},
"downloads": -1,
"filename": "ydf-0.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "f2cbec6548087e71e8814306d608c5fd",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 10571911,
"upload_time": "2025-02-11T13:33:15",
"upload_time_iso_8601": "2025-02-11T13:33:15.111391Z",
"url": "https://files.pythonhosted.org/packages/72/5f/7940c59e3a74368183c48f03666245ccb09b4c92993e990bcaa667f7e711/ydf-0.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-11 13:32:42",
"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"
}