Skip to content

Commit 6094ec0

Browse files
authored
Merge pull request #1 from tensorflow/test_374201786
Release of v0.1.1
2 parents 1473751 + 36017da commit 6094ec0

File tree

21 files changed

+1606
-207
lines changed

21 files changed

+1606
-207
lines changed

.bazelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ build --nocheck_visibility
2222
# Yggdrasil uses tensorflow for IO.
2323
build --define=use_tensorflow_io=1
2424

25+
# Pre-compiled wrappers.
26+
build --define=use_precompiled_wrappers=1
27+
2528
# TensorFlow uses an old version of Absl without StatusOr, so Yggdrasil uses
2629
# its own implementation.
2730
build --define=no_absl_statusor=1

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## 0.1.1 - 2021-05-17
4+
5+
### Features
6+
7+
- Migration to TensorFlow 2.5.0.
8+
- By default, use a pre-compiled version of the OP wrappers.
9+
10+
### Bug fix
11+
12+
- Add missing `plotter.js` from Pip package.
13+
- Use GitHub version of Yggdrasil Decision Forests by default.
14+
315
## 0.1.0 - 2021-05-11
416

517
Initial Release of TensorFlow Decision Forests.

WORKSPACE

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
88
# absl used by tensorflow.
99
http_archive(
1010
name = "org_tensorflow",
11-
#sha256 = "b91ec194ddf6c4a5a2f9d1db4af4daab0b187ff691e6f88142413d2c7e77a3bb",
12-
#strip_prefix = "tensorflow-2.4.1",
13-
#urls = ["https://github.com/tensorflow/tensorflow/archive/v2.4.1.zip"],
14-
15-
sha256 = "f7ad0a488559ee01f042a967c065482b074e11afd0299facbd8dc0cba9ae3fa9",
16-
strip_prefix = "tensorflow-2.5.0-rc3",
17-
urls = ["https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.5.0-rc3.zip"],
11+
sha256 = "e3d0ee227cc19bd0fa34a4539c8a540b40f937e561b4580d4bbb7f0e31c6a713",
12+
strip_prefix = "tensorflow-2.5.0",
13+
urls = ["https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.5.0.zip"],
1814

1915
#urls = ["https://github.com/tensorflow/tensorflow/archive/master.zip"],
2016
#strip_prefix = "tensorflow-master",

configure/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
include LICENSE
22
include README
3+
include tensorflow_decision_forests/component/model_plotter/plotter.js
34
recursive-include * *.so
45
recursive-include * *.so.[0-9]
56
recursive-include * *.dylib

configure/setup.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,43 @@
1717
This file is used by tools/build_pip_package.sh.
1818
"""
1919
import setuptools
20+
from setuptools.command.install import install
2021
from setuptools.dist import Distribution
2122

22-
_VERSION = "0.1.0"
23+
_VERSION = "0.1.1"
2324

2425
with open("README.md", "r", encoding="utf-8") as fh:
2526
long_description = fh.read()
2627

2728
REQUIRED_PACKAGES = [
2829
"numpy",
2930
"pandas",
30-
"tensorflow==2.5.0rc3",
31+
"tensorflow~=2.5",
3132
"six",
3233
"absl_py",
3334
"wheel",
3435
]
3536

3637

38+
class InstallPlatlib(install):
39+
40+
def finalize_options(self):
41+
install.finalize_options(self)
42+
if self.distribution.has_ext_modules():
43+
self.install_lib = self.install_platlib
44+
45+
3746
class BinaryDistribution(Distribution):
3847

3948
def has_ext_modules(self):
4049
return True
4150

51+
def is_pure(self):
52+
return False
53+
4254

4355
setuptools.setup(
56+
cmdclass={"install": InstallPlatlib},
4457
name="tensorflow_decision_forests",
4558
version=_VERSION,
4659
author="Google Inc.",

documentation/installation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Download and compile TensorFlow Decision Forests as follow:
5252
```shell
5353
# Download the source code.
5454
git clone https://github.com/tensorflow/decision-forests.git
55-
cd tensorflow_decision_forests
55+
cd decision-forests
5656

5757
# Download TensorFlow's BazelRC.
5858
# See "tensorflow_bazelrc" for the compilation options.
@@ -62,13 +62,13 @@ TENSORFLOW_BAZELRC="tensorflow_bazelrc"
6262
wget https://raw.githubusercontent.com/tensorflow/tensorflow/master/.bazelrc -O ${TENSORFLOW_BAZELRC}
6363

6464
# Compile TensorFlow Decision Forests.
65-
bazel-3.7.2 build //tensorflow_decision_forests/...:all --bazelrc=${TENSORFLOW_BAZELRC} --config=linux
65+
bazel-3.7.2 --bazelrc=${TENSORFLOW_BAZELRC} build //tensorflow_decision_forests/...:all --config=linux
6666

6767
# Create a pip package.
68-
./tools/build_pip_package.sh
68+
./tools/build_pip_package.sh simple
6969

7070
# Install the pip package
71-
pip3 install dist/tensorflow_decision_forests-0.1.0.tar.gz
71+
pip3 install dist/*.whl
7272
```
7373

7474
**Note:** Compiling TensorFlow Decision Forests compiles a large part of

documentation/tutorials/advanced_colab.ipynb

Lines changed: 8 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@
4444
" \u003ca target=\"_blank\" href=\"https://www.tensorflow.org/decision_forests/tutorials/advanced_colab\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" /\u003eView on TensorFlow.org\u003c/a\u003e\n",
4545
" \u003c/td\u003e\n",
4646
" \u003ctd\u003e\n",
47-
" \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/decision_forests/blob/master/documentation/tutorials/advanced_colab.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" /\u003eRun in Google Colab\u003c/a\u003e\n",
47+
" \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/decision-forests/blob/main/documentation/tutorials/advanced_colab.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" /\u003eRun in Google Colab\u003c/a\u003e\n",
4848
" \u003c/td\u003e\n",
4949
" \u003ctd\u003e\n",
50-
" \u003ca target=\"_blank\" href=\"https://github.com/tensorflow/decision_forests/blob/master/documentation/tutorials/advanced_colab.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" /\u003eView on GitHub\u003c/a\u003e\n",
50+
" \u003ca target=\"_blank\" href=\"https://github.com/tensorflow/decision-forests/blob/main/documentation/tutorials/advanced_colab.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" /\u003eView on GitHub\u003c/a\u003e\n",
5151
" \u003c/td\u003e\n",
5252
" \u003ctd\u003e\n",
53-
" \u003ca href=\"https://storage.googleapis.com/tensorflow_docs/decision_forests/documentation/tutorials/advanced_colab.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/download_logo_32px.png\" /\u003eDownload notebook\u003c/a\u003e\n",
53+
" \u003ca href=\"https://storage.googleapis.com/tensorflow_docs/decision-forests/documentation/tutorials/advanced_colab.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/download_logo_32px.png\" /\u003eDownload notebook\u003c/a\u003e\n",
5454
" \u003c/td\u003e\n",
5555
"\u003c/table\u003e\n"
5656
]
@@ -80,8 +80,11 @@
8080
},
8181
"outputs": [],
8282
"source": [
83-
"# Install TensorFlow Dececision Forests\n",
84-
"!pip install tensorflow_decision_forests"
83+
"# Install TensorFlow Dececision Forests.\n",
84+
"!pip install tensorflow_decision_forests\n",
85+
"\n",
86+
"# Use wurlitzer to capture training logs.\n",
87+
"!pip install wurlitzer"
8588
]
8689
},
8790
{
@@ -176,7 +179,6 @@
176179
},
177180
"outputs": [],
178181
"source": [
179-
"%output_height 300px\n",
180182
"model.summary()"
181183
]
182184
},
@@ -189,30 +191,6 @@
189191
"Remark the multiple variable importances with name `MEAN_DECREASE_IN_*`."
190192
]
191193
},
192-
{
193-
"cell_type": "markdown",
194-
"metadata": {
195-
"id": "xTwmx8A0c4TU"
196-
},
197-
"source": [
198-
"## Plotting the model\n",
199-
"\n",
200-
"Next, we plot our model.\n",
201-
"\n",
202-
"A Random Forest is a large model (this model has 300 trees and ~5k nodes; see the summary above). Therefore, we will only plot the first tree, and limit the nodes to depth 3."
203-
]
204-
},
205-
{
206-
"cell_type": "code",
207-
"execution_count": null,
208-
"metadata": {
209-
"id": "ZRTrXDz_dIAQ"
210-
},
211-
"outputs": [],
212-
"source": [
213-
"tfdf.model_plotter.plot_model_in_colab(model, tree_idx=0, max_depth=3)"
214-
]
215-
},
216194
{
217195
"cell_type": "markdown",
218196
"metadata": {
@@ -612,26 +590,6 @@
612590
"inspector = tfdf.inspector.make_inspector(yggdrasil_model_path)\n",
613591
"print(\"Input features:\", inspector.features())"
614592
]
615-
},
616-
{
617-
"cell_type": "markdown",
618-
"metadata": {
619-
"id": "muW1hgmotx8J"
620-
},
621-
"source": [
622-
"And of course, you can plot the model :)"
623-
]
624-
},
625-
{
626-
"cell_type": "code",
627-
"execution_count": null,
628-
"metadata": {
629-
"id": "bqahDVg3t1xM"
630-
},
631-
"outputs": [],
632-
"source": [
633-
"tfdf.model_plotter.plot_model_in_colab(manual_model)"
634-
]
635593
}
636594
],
637595
"metadata": {

0 commit comments

Comments
 (0)