diff --git a/examples/07_detection_anomaly_changepoints.ipynb b/examples/07_detection_anomaly_changepoints.ipynb index 7db8b71e977..d7a4ad563c8 100644 --- a/examples/07_detection_anomaly_changepoints.ipynb +++ b/examples/07_detection_anomaly_changepoints.ipynb @@ -838,7 +838,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "id": "3af4e386-e7fa-4a03-a324-305d6d864ae6", "metadata": {}, "outputs": [ @@ -856,7 +856,7 @@ "from sktime.detection.bs import BinarySegmentation\n", "\n", "model = BinarySegmentation(threshold=1000)\n", - "predicted_change_points = model.fit_predict(df)\n", + "predicted_change_points = model.fit_predict(df[\"KSI\"])\n", "print(predicted_change_points)" ] }, diff --git a/sktime/detection/bs.py b/sktime/detection/bs.py index 4b4dc2e084a..adcd652c6c6 100644 --- a/sktime/detection/bs.py +++ b/sktime/detection/bs.py @@ -43,13 +43,13 @@ class BinarySegmentation(BaseDetector): >>> model = BinarySegmentation(threshold=1) >>> X = pd.Series([1, 1, 1, 1, 5, 5, 5, 5]) >>> model.fit_predict(X) - 0 3 - dtype: int64 + ilocs + 0 3 >>> X = pd.Series([1.1, 1.3, -1.4, -1.4, 5.5, 5.6]) >>> model.fit_predict(X) - 0 1 - 1 3 - dtype: int64 + ilocs + 0 1 + 1 3 """ _tags = { @@ -63,6 +63,7 @@ class BinarySegmentation(BaseDetector): "univariate-only": True, "task": "change_point_detection", "learning_type": "unsupervised", + "X_inner_mtype": "pd.Series", } def __init__(self, threshold, min_cp_distance=0, max_iter=10000): @@ -202,4 +203,6 @@ def get_test_params(cls, parameter_set="default"): instance. ``create_test_instance`` uses the first (or only) dictionary in ``params`` """ - return {"threshold": 1} + params0 = {"threshold": 1} + params1 = {"threshold": 0.1, "min_cp_distance": 1, "max_iter": 100} + return [params0, params1] diff --git a/sktime/tests/_config.py b/sktime/tests/_config.py index 511a236ccce..4a44a24cc5c 100644 --- a/sktime/tests/_config.py +++ b/sktime/tests/_config.py @@ -257,10 +257,6 @@ "test_transform_output_type", "test_output_type", ], - "BinarySegmentation": [ - "test_predict_segments", - "test_transform_output_type", - ], "GreedyGaussianSegmentation": [ "test_predict_points", "test_predict_segments", @@ -282,7 +278,6 @@ "Arsenal", "BaggingForecaster", "BOSSEnsemble", - "BinarySegmentation", "CNTCClassifier", "CNTCNetwork", "CNTCRegressor",