Strange anomaly scores of DWT_MLEAD with some basic time series #2126
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey, @CodeLionX might have some element of answer on this point, unfortunately I'm not that familiar with the method to interpret these results. (He may be on holiday for now until the 8th). |
Beta Was this translation helpful? Give feedback.
-
Hi @Noskario, Thank you for your patience. You are right. Your strange anomaly scores are an artifact of the padding to the next power of 2. This plot shows the padded series in row two: We can see that the last part of the series just occurs once and thus has the highest anomaly score. Unfortunately, DWT-MLEAD does not work well on non-periodic time series or time series with no reoccurring patterns, especially if the time series is very short. Script to reproduce figure: import matplotlib.pyplot as plt
import numpy as np
from aeon.anomaly_detection import DWT_MLEAD
from aeon.anomaly_detection._dwt_mlead import _pad_series
N = 100
def main():
X = np.concatenate(
(np.full(N, 0), np.linspace(0, 1, N), np.full(N, 1)), dtype=np.float_
)
fig, axs = plt.subplots(3, sharex="all", layout="tight")
axs[0].set_title("Original")
axs[0].scatter(x=np.arange(X.shape[0]), y=X)
padded_x, _, _ = _pad_series(X)
axs[1].set_title("Padded")
axs[1].plot(padded_x)
detector = DWT_MLEAD()
scores = detector.fit_predict(X)
axs[2].set_title("Scores")
axs[-1].plot(scores)
plt.show()
if __name__ == "__main__":
main() |
Beta Was this translation helpful? Give feedback.
Hi @Noskario,
Thank you for your patience.
You are right. Your strange anomaly scores are an artifact of the padding to the next power of 2. This plot shows the padded series in row two:
We can see that the last part of the series just occurs once and thus has the highest anomaly score. Unfortunately, DWT-MLEAD does not work well on non-periodic time series or time series with no reoccurring patterns, especially if the time series is very short.
Script to reproduce figure: