Skip to content

Commit

Permalink
[ENH] Add test parameter set for STRAY (#7420)
Browse files Browse the repository at this point in the history
Towards #3429

Add a second test parameter set for STRAY
  • Loading branch information
tajir0 authored Nov 27, 2024
1 parent 1b265ce commit 8eb0573
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -3192,6 3192,16 @@
"doc"
]
},
{
"login": "tajir0",
"name": "Jinrong Tang",
"avatar_url": "https://avatars.githubusercontent.com/u/36022362",
"profile": "https://github.com/tajir0",
"contributions": [
"code",
"test"
]
},
{
"login": "mjste",
"name": "Michał Stefanik",
Expand Down
28 changes: 28 additions & 0 deletions sktime/detection/stray.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 261,31 @@ def _transform(self, X: npt.ArrayLike, y: npt.ArrayLike = None) -> npt.ArrayLike
return new_obj.y_.astype(bool)

return self.y_.astype(bool)

@classmethod
def get_test_params(cls, parameter_set="default"):
"""Return testing parameter settings for the estimator.
Parameters
----------
parameter_set : str, default="default"
Name of the set of test parameters to return, for use in tests. If no
special parameters are defined for a value, will return ``"default"`` set.
Returns
-------
params : dict or list of dict, default = {}
Parameters to create testing instances of the class
Each dict are parameters to construct an "interesting" test instance, i.e.,
``MyClass(**params)`` or ``MyClass(**params[i])`` creates a valid test
instance.
``create_test_instance`` uses the first (or only) dictionary in ``params``
"""
params1 = {}
params2 = {
"alpha": 0.15,
"k": 20,
"knn_algorithm": "ball_tree",
"outlier_tail": "min",
}
return [params1, params2]
1 change: 0 additions & 1 deletion sktime/tests/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 407,6 @@
"SAXlegacy",
"SFA",
"SFAFast",
"STRAY",
"ShapeletTransform",
"ShapeletTransformClassifier",
"SignatureClassifier",
Expand Down

0 comments on commit 8eb0573

Please sign in to comment.