Skip to content

Commit

Permalink
min_segments to max_segments, tree in the notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Polyakov committed May 13, 2024
1 parent 2f95f4f commit 3867de9
Show file tree
Hide file tree
Showing 3 changed files with 255 additions and 51 deletions.
278 changes: 241 additions & 37 deletions notebooks/Finding interesting segments.ipynb

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions tests/test_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def test_synthetic_template(nan_percent: float, clustering: bool):
total_name=all_data.segment_total,
size_name=all_data.segment_size,
max_depth=2,
min_segments=5,
max_segments=5,
verbose=1,
solver="lp",
cluster_values=clustering,
Expand Down Expand Up @@ -227,7 +227,7 @@ def test_synthetic_ts_template(nan_percent: float):
time_name=all_data.time_col,
size_name=all_data.segment_size,
max_depth=2,
min_segments=5,
max_segments=5,
verbose=True,
)
print("***")
Expand Down Expand Up @@ -277,7 +277,7 @@ def test_deltas(
all_data.segment_size,
how=how,
max_depth=1,
min_segments=10,
max_segments=10,
solver=solver,
cluster_values=cluster_values
)
Expand All @@ -302,7 +302,7 @@ def test_explain_levels(solver: str, nan_percent: float, size_one_percent: float
total_name=all_data.segment_total,
size_name=all_data.segment_size,
max_depth=1,
min_segments=10,
max_segments=10,
solver=solver,
)
print(sf.summary())
Expand Down
20 changes: 10 additions & 10 deletions wise_pizza/explain.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def explain_changes_in_average(
dims: List[str],
total_name: str,
size_name: str,
min_segments: int = 5,
max_segments: Optional[int] = None,
min_segments: Optional[int] = None,
max_segments: int = 5,
min_depth: int = 1,
max_depth: int = 2,
solver: str = "lasso",
Expand Down Expand Up @@ -123,8 +123,8 @@ def explain_changes_in_totals(
dims: List[str],
total_name: str,
size_name: str,
min_segments: int = 5,
max_segments: Optional[int] = None,
min_segments: Optional[int] = None,
max_segments: int = 5,
min_depth: int = 1,
max_depth: int = 2,
solver: str = "lasso",
Expand Down Expand Up @@ -270,8 +270,8 @@ def explain_levels(
dims: List[str],
total_name: str,
size_name: Optional[str] = None,
min_segments: int = 10,
max_segments: int = None,
min_segments: int = None,
max_segments: int = 10,
min_depth: int = 1,
max_depth: int = 2,
solver="lasso",
Expand Down Expand Up @@ -352,8 +352,8 @@ def explain_timeseries(
total_name: str,
time_name: str,
size_name: Optional[str] = None,
min_segments: int = 5,
max_segments: int = None,
min_segments: int = None,
max_segments: int = 5,
min_depth: int = 1,
max_depth: int = 2,
solver: str = "omp",
Expand Down Expand Up @@ -517,8 +517,8 @@ def _explain_timeseries(
total_name: str,
time_name: str,
size_name: Optional[str] = None,
min_segments: int = 5,
max_segments: int = None,
min_segments: int = None,
max_segments: int = 5,
min_depth: int = 1,
max_depth: int = 2,
solver: str = "omp",
Expand Down

0 comments on commit 3867de9

Please sign in to comment.