Skip to content

Commit

Permalink
Release YDF 0.5.0
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 644269898
  • Loading branch information
achoum authored and copybara-github committed Jun 18, 2024
1 parent a1f7081 commit 74026c8
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 10 deletions.
8 changes: 7 additions & 1 deletion yggdrasil_decision_forests/port/python/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## HEAD
## 0.5.0 - 2024-06-17

### Feature

Expand All @@ -10,6 +10,12 @@
more convenient than`ydf.verbose`.
- Add SKLearn to YDF model converter: `ydf.from_sklearn`.
- Improve error messages when calling the model with non supported data.
- Add support for numpy 2.0.

### Tutorials

- Add anomaly detection tutorial.
- Add YDF and JAX model composition tutorial.

### Fix

Expand Down
2 changes: 1 addition & 1 deletion 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.4.3"
_VERSION = "0.5.0"

with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
cls
setlocal

set YDF_VERSION=0.4.3
set YDF_VERSION=0.5.0
set BAZEL=bazel.exe
set BAZEL_SH=C:\msys64\usr\bin\bash.exe
set BAZEL_FLAGS=--config=windows_cpp20 --config=windows_avx2
Expand Down
6 changes: 3 additions & 3 deletions yggdrasil_decision_forests/port/python/ydf/dataset/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def _add_column(
column_data.dtype.type
in [
np.object_,
np.string_,
np.bytes_,
np.str_,
]
or column_data.dtype.type in dataspec.NP_SUPPORTED_INT_DTYPE
Expand Down Expand Up @@ -215,7 +215,7 @@ def _add_column(

if column_data.dtype.type in [
np.object_,
np.string_,
np.bytes_,
np.bool_,
] or np.issubdtype(column_data.dtype, np.integer):
column_data = column_data.astype(np.bytes_)
Expand Down Expand Up @@ -648,7 +648,7 @@ def infer_semantic(name: str, data: Any) -> dataspec.Semantic:
):
return dataspec.Semantic.NUMERICAL

if data.dtype.type in [np.string_, np.bytes_, np.str_]:
if data.dtype.type in [np.bytes_, np.str_]:
return dataspec.Semantic.CATEGORICAL

if data.dtype.type in [np.object_]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class GenericDatasetTest(parameterized.TestCase):
(np.array([1], np.float64), Semantic.NUMERICAL),
(np.array([1], np.bool_), Semantic.BOOLEAN),
(np.array(["a"], np.bytes_), Semantic.CATEGORICAL),
(np.array(["a"], np.string_), Semantic.CATEGORICAL),
(np.array(["a", np.nan], np.object_), Semantic.CATEGORICAL),
)
def test_infer_semantic(self, value, expected_semantic):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
np.float32: ds_pb.DType.DTYPE_FLOAT32,
np.float64: ds_pb.DType.DTYPE_FLOAT64,
np.bool_: ds_pb.DType.DTYPE_BOOL,
np.string_: ds_pb.DType.DTYPE_BYTES,
np.str_: ds_pb.DType.DTYPE_BYTES,
np.bytes_: ds_pb.DType.DTYPE_BYTES,
np.object_: ds_pb.DType.DTYPE_BYTES,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def test_almost_equal(a, b) -> Optional[str]:
if a.dtype != b.dtype:
return f"numpy array type mismatch: {a} != {b}"

if a.dtype.type in [np.string_, np.bytes_, np.str_]:
if a.dtype.type in [np.bytes_, np.str_]:
if not np.equal(a, b).all():
return f"numpy array mismatch: {a} != {b}"
else:
Expand Down
2 changes: 1 addition & 1 deletion yggdrasil_decision_forests/port/python/ydf/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

version = "0.4.3"
version = "0.5.0"

0 comments on commit 74026c8

Please sign in to comment.