Skip to content

Commit c512038

Browse files
authored
Fixed #574 Finalize mmotifs (#578)
* Made excl_zone optional in _multi_distance_profile funcs * Finalized aamp_mmotifs and mmotifs, fixed typos
1 parent 3e991ac commit c512038

File tree

2 files changed

+31
-28
lines changed

2 files changed

+31
-28
lines changed

stumpy/aamp_mmotifs.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,12 @@ def aamp_mmotifs(
5757
cutoffs: numpy.ndarray or float, default None
5858
The largest matrix profile value (distance) for each dimension of the
5959
multidimensional matrix profile that a multidimenisonal candidate motif is
60-
allowed to have.
61-
If cutoffs is only one value, these value will be applied to every dimension.
60+
allowed to have. If `cutoffs` is a scalar value, then this value will be
61+
applied to every dimension.
6262
6363
max_matches: int, default 10
64-
The maximum amount of similar matches (nearest neighbors) of a motif
65-
representative to be returned.
66-
The first match is always the self-match for each motif.
64+
The maximum number of similar matches (nearest neighbors) to return for each
65+
motif. The first match is always the self/trivial-match for each motif.
6766
6867
max_motifs: int, default 1
6968
The maximum number of motifs to return
@@ -73,18 +72,14 @@ def aamp_mmotifs(
7372
when comparing distances between subsequences.
7473
7574
k: int, default None
76-
The number of dimensions (k + 1) in which a motif is present.
77-
This value is available for doing guided search or - together with 'include' -
78-
for constrained search.
79-
The value will be applied to the discovery of all motifs.
80-
If k is None, the value will automatically be computed for each motif using
81-
MDL (unconstrained search).
82-
For more informatioin on search types, see DOI: 10.1109/ICDM.2017.66s
75+
The number of dimensions (`k + 1`) required for discovering all motifs. This
76+
value is available for doing guided search or, together with `include`, for
77+
constrained search. If `k is None`, then this will be automatically be computed
78+
for each motif using MDL (unconstrained search).
8379
8480
include: numpy.ndarray, default None
8581
A list of (zero based) indices corresponding to the dimensions in T that must be
86-
included in the constrained multidimensional motif search. For more information,
87-
see Section IV D in: DOI: 10.1109/ICDM.2017.66
82+
included in the constrained multidimensional motif search.
8883
8984
p: float, default 2.0
9085
The p-norm to apply for computing the Minkowski distance.
@@ -104,6 +99,13 @@ def aamp_mmotifs(
10499
motif_mdls: list
105100
A list consisting of arrays that contain the mdl results for
106101
finding the dimension of each motif
102+
103+
Notes
104+
-----
105+
`DOI: 10.1109/ICDM.2017.66 \
106+
<https://www.cs.ucr.edu/~eamonn/Motif_Discovery_ICDM.pdf>`__
107+
108+
For more information on `include` and search types, see Section IV D and IV E
107109
"""
108110
T = core._preprocess(T)
109111
m = T.shape[-1] - P.shape[-1] + 1

stumpy/mmotifs.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,12 @@ def mmotifs(
5757
cutoffs: numpy.ndarray or float, default None
5858
The largest matrix profile value (distance) for each dimension of the
5959
multidimensional matrix profile that a multidimenisonal candidate motif is
60-
allowed to have.
61-
If cutoffs is only one value, these value will be applied to every dimension.
60+
allowed to have. If `cutoffs` is a scalar value, then this value will be
61+
applied to every dimension.
6262
6363
max_matches: int, default 10
64-
The maximum amount of similar matches (nearest neighbors) of a motif
65-
representative to be returned.
66-
The first match is always the self-match for each motif.
64+
The maximum number of similar matches (nearest neighbors) to return for each
65+
motif. The first match is always the self/trivial-match for each motif.
6766
6867
max_motifs: int, default 1
6968
The maximum number of motifs to return
@@ -73,18 +72,14 @@ def mmotifs(
7372
when comparing distances between subsequences.
7473
7574
k: int, default None
76-
The number of dimensions (k + 1) in which a motif is present.
77-
This value is available for doing guided search or - together with 'include' -
78-
for constrained search.
79-
The value will be applied to the discovery of all motifs.
80-
If k is None, the value will automatically be computed for each motif using
81-
MDL (unconstrained search).
82-
For more informatioin on search types, see DOI: 10.1109/ICDM.2017.66s
75+
The number of dimensions (`k + 1`) required for discovering all motifs. This
76+
value is available for doing guided search or, together with `include`, for
77+
constrained search. If `k is None`, then this will be automatically be computed
78+
for each motif using MDL (unconstrained search).
8379
8480
include: numpy.ndarray, default None
8581
A list of (zero based) indices corresponding to the dimensions in T that must be
86-
included in the constrained multidimensional motif search. For more information,
87-
see Section IV D in: DOI: 10.1109/ICDM.2017.66
82+
included in the constrained multidimensional motif search.
8883
8984
normalize : bool, default True
9085
When set to `True`, this z-normalizes subsequences prior to computing distances.
@@ -123,6 +118,12 @@ def mmotifs(
123118
stumpy.mdl : Compute the number of bits needed to compress one array with another
124119
using the minimum description length (MDL)
125120
121+
Notes
122+
-----
123+
`DOI: 10.1109/ICDM.2017.66 \
124+
<https://www.cs.ucr.edu/~eamonn/Motif_Discovery_ICDM.pdf>`__
125+
126+
For more information on `include` and search types, see Section IV D and IV E
126127
"""
127128
T = core._preprocess(T)
128129
m = T.shape[-1] - P.shape[-1] + 1

0 commit comments

Comments
 (0)