Skip to content

Commit

Permalink
Release Version 0.0.2, fix matplotlib dependency
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 571078099
  • Loading branch information
rstz authored and copybara-github committed Oct 5, 2023
1 parent 0cd75ba commit 2f1d1c4
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
12 changes: 11 additions & 1 deletion yggdrasil_decision_forests/port/python/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 0.0.2 - 2023-10-05

### Features

- Model analysis

#### Release music

When You’re Smiling. Larry Shay, Mark Fisher and Joe Goodwin

## 0.0.1 - 2023-10-03

Initial Alpha Release
Expand All @@ -12,4 +22,4 @@ Initial Alpha Release

#### Release music

Frisch heran (Opus 386), Johann Strauss (Sohn)
Frisch heran (Opus 386). Johann Strauss (Sohn)
24 changes: 23 additions & 1 deletion yggdrasil_decision_forests/port/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@ To install YDF, in Python, simply grab the package from pip:
pip install ydf
```

## 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")
```

## Compiling & Building

To build the Python port of YDF, install GCC-9 and run the following command
Expand All @@ -37,6 +56,9 @@ PYTHON_BIN=python3.9
* **What is the status of PYDF?** PYDF is currently in Alpha development. Some
parts still work well (training models and generating predictions), others
are yet to be added. The API surface may still change without notice.
* **How should you pronounce PYDF?** The preferred pronunciation is
* **Where is the documentation for PYDF?** We are still creating the
PYDF-specifc documentation, it will be hosted on https://ydf.readthedocs.org
soon.
* **How should I pronounce PYDF?** The preferred pronunciation is
"Py-dee-eff" / ˈpaɪˈdiˈɛf (IPA)

4 changes: 2 additions & 2 deletions yggdrasil_decision_forests/port/python/config/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from setuptools.command.install import install
from setuptools.dist import Distribution

_VERSION = "0.0.1"
_VERSION = "0.0.2"

with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
Expand All @@ -32,7 +32,7 @@
"protobuf>=3.14",
]

OPTIONAL_PACKAGES = {"pandas": ["pandas"], "plot": ["matplotlib"]}
OPTIONAL_PACKAGES = {"pandas": ["pandas"], "matplotlib": ["matplotlib"]}


class InstallPlatlib(install):
Expand Down
2 changes: 1 addition & 1 deletion yggdrasil_decision_forests/port/python/ydf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from ydf.model import generic_model as _generic_model
from ydf.model import model_lib as _model_lib

__version__ = "0.0.0"
__version__ = "0.0.2"

# Dataset
create_vertical_dataset = _dataset.create_vertical_dataset
Expand Down

0 comments on commit 2f1d1c4

Please sign in to comment.