Skip to content

Commit

Permalink
Fix bug in python package when passing max_features='sqrt'. (#105)
Browse files Browse the repository at this point in the history
* Fix bug in python package when passing max_features='sqrt'.

* Bump version.

* Typo.
  • Loading branch information
mlondschien authored Apr 6, 2022
1 parent 2aefb29 commit a8f7e4b
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 10 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@

# Changelog

## 0.6.1 - (2022-04-06)

**Bug fixes:**

- Fixed a bug in the Python package when passing `random_forest_max_features='sqrt'` to `Control`.

## 0.6.0 - (2022-03-17)

**Breaking changes:**

- The default value for `model_selection_n_permutations` is now 199.
- The default value for `model_selection_alpha` is now 0.02
- The default value for `model_selection_alpha` is now 0.02.
- The default value for `minimal_gain_to_split`, use in the `change_in_mean` setup, is now `log(n) * (d + 1)`, motivated by the BIC and [1].
- The value for `minimal_gain_to_split` no longer gets automatically multiplied by `n`.

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "changeforest"
description = "Classifier based non-parametric change point detection."
authors = ["Malte Londschien <malte@londschien.ch>"]
repository = "https://github.com/mlondschien/changeforest/"
version = "0.6.0"
version = "0.6.1"
edition = "2021"
readme = "README.md"
license = "BSD-3-Clause"
Expand Down
2 changes: 1 addition & 1 deletion changeforest-py/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "changeforest_py"
version = "0.6.0"
version = "0.6.1"
edition = "2021"

[lib]
Expand Down
8 changes: 4 additions & 4 deletions changeforest-py/changeforest/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ def __init__(
def _to_float(value):
if value is None:
return None
if value == "default":
return "default"
elif isinstance(value, str):
return value
else:
return float(value)


def _to_int(value):
if value is None:
return None
if value == "default":
return "default"
elif isinstance(value, str):
return value
else:
return int(value)
2 changes: 1 addition & 1 deletion changeforest-py/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "changeforest"
description = "Classifier based non-parametric change point detection"
readme = "README.md"
version = "0.6.0"
version = "0.6.1"
requires-python = ">=3.7"
author = "Malte Londschien <malte@londschien.ch>"
urls = {homepage = "https://github.com/mlondschien/changeforest/"}
Expand Down
7 changes: 7 additions & 0 deletions changeforest-py/tests/test_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@
("X_test", "bs", "random_forest", {"random_forest_n_estimators": 100}, [5]),
("X_correlated", "bs", "random_forest", {"random_forest_max_depth": 1}, []),
("X_correlated", "bs", "random_forest", {"random_forest_max_depth": 2}, [49]),
(
"X_correlated",
"bs",
"random_forest",
{"random_forest_max_features": "sqrt"},
[49],
),
("iris", "bs", "random_forest", {"model_selection_n_permutations": 10}, []),
],
)
Expand Down
2 changes: 1 addition & 1 deletion changeforest-r/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: changeforest
Type: Package
Title: Classifier Based Non-Parametric Change Point Detection
Version: 0.6.0
Version: 0.6.1
Author: Malte Londschien
Maintainer: Malte Londschien <malte@londschien.ch>
Description: Perform classifier based multivariate, non-parametric change point detection.
Expand Down
2 changes: 1 addition & 1 deletion changeforest-r/src/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = 'changeforestr'
version = '0.6.0'
version = '0.6.1'
edition = '2021'

[lib]
Expand Down

0 comments on commit a8f7e4b

Please sign in to comment.