Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Refactor BinSegSegmenter to BinSegmenter #2408

Merged
merged 8 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions aeon/segmentation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__all__ = [
"BaseSegmenter",
"BinSegSegmenter",
"BinSegmenter",
"FLUSSSegmenter",
"ClaSPSegmenter",
"find_dominant_window_sizes",
Expand All @@ -15,7 +15,7 @@
"HidalgoSegmenter",
]

from aeon.segmentation._binseg import BinSegSegmenter
from aeon.segmentation._binseg import BinSegmenter
from aeon.segmentation._clasp import ClaSPSegmenter, find_dominant_window_sizes
from aeon.segmentation._eagglo import EAggloSegmenter
from aeon.segmentation._fluss import FLUSSSegmenter
Expand Down
8 changes: 4 additions & 4 deletions aeon/segmentation/_binseg.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"""BinSeg (Binary segmentation) Segmenter."""

__maintainer__ = []
__all__ = ["BinSegSegmenter"]
__all__ = ["BinSegmenter"]

import numpy as np
import pandas as pd

from aeon.segmentation.base import BaseSegmenter


class BinSegSegmenter(BaseSegmenter):
class BinSegmenter(BaseSegmenter):
"""BinSeg (Binary Segmentation) Segmenter.

From the Ruptures documentation:
Expand Down Expand Up @@ -46,10 +46,10 @@ class BinSegSegmenter(BaseSegmenter):

Examples
--------
>>> from aeon.segmentation import BinSegSegmenter
>>> from aeon.segmentation import BinSegmenter
>>> from aeon.datasets import load_gun_point_segmentation
>>> X, true_period_size, cps = load_gun_point_segmentation()
>>> binseg = BinSegSegmenter(n_cps=1) # doctest: +SKIP
>>> binseg = BinSegmenter(n_cps=1) # doctest: +SKIP
>>> found_cps = binseg.fit_predict(X) # doctest: +SKIP
"""

Expand Down
4 changes: 2 additions & 2 deletions aeon/segmentation/tests/test_binseg.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest

from aeon.datasets import load_gun_point_segmentation
from aeon.segmentation import BinSegSegmenter
from aeon.segmentation import BinSegmenter
from aeon.utils.validation._dependencies import _check_soft_dependencies


Expand All @@ -23,7 +23,7 @@ def test_binseg_sparse():
ts, _, cps = load_gun_point_segmentation()

# compute a BinSeg segmentation
binseg = BinSegSegmenter(n_cps=1)
binseg = BinSegmenter(n_cps=1)
found_cps = binseg.fit_predict(ts)

assert len(found_cps) == 1 and found_cps[0] == 1870
2 changes: 1 addition & 1 deletion aeon/testing/testing_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"GreedyGaussianSegmenter": ["check_non_state_changing_method"],
"ClaSPSegmenter": ["check_non_state_changing_method"],
"HMMSegmenter": ["check_non_state_changing_method"],
"BinSegSegmenter": ["check_non_state_changing_method"],
"BinSegmenter": ["check_non_state_changing_method"],
"QUANTTransformer": ["check_non_state_changing_method"],
"MatrixProfileSeriesTransformer": ["check_non_state_changing_method"],
"PLASeriesTransformer": ["check_non_state_changing_method"],
Expand Down
2 changes: 1 addition & 1 deletion docs/api_reference/segmentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ contains algorithms and tools for time series segmentation.
:toctree: auto_generated/
:template: class.rst

BinSegSegmenter
BinSegmenter
ClaSPSegmenter
FLUSSSegmenter
InformationGainSegmenter
Expand Down