Click4Ai

510.

Hard

Anomaly Detection in Time Series

Problem Statement:

Given a time series dataset, detect anomalies using the Z-score method.

Constraints:

  • Time series data is a 2D array with shape (n_samples, n_features).
  • Features in the time series data are expected to have a normal distribution.
  • Example:

    Suppose we have a time series dataset with two features. We want to detect anomalies in the dataset.

    Test Cases

    Test Case 1
    Input: [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10], [100, 100]]
    Expected: [[False, False], [False, False], [False, False], [False, False], [False, False], [True, True]]
    Test Case 2
    Input: [[10, 20], [30, 40], [50, 60], [70, 80], [90, 100], [110, 120]]
    Expected: [[False, False], [False, False], [False, False], [False, False], [False, False], [False, False]]
    + 3 hidden test cases