generate_anomalous_data — skchange

Skip to main content
`Ctrl`+`K`

# generate_anomalous_data

generate_anomalous_data(n: int = 100, anomalies: tuple[int, int] | list[tuple[int, int]] = (71, 80), means: float | list[float] | list[ndarray] = 3.0, variances: float | list[float] | list[ndarray] = 1.0, random_state: int | None = None) → DataFrame

  Generate multivariate normal data with anomalies.

  Parameters:
    nint, optional (default=100)

      Number of observations.

    anomalieslist of tuples, optional (default=[(71, 80)])

      List of tuples of the form (start, end) indicating the start and end of an anomaly.

    meanslist of floats or list of arrays, optional (default=[0.0])

      List of means for each segment.

    varianceslist of floats or list of arrays, optional (default=[1.0])

      List of variances for each segment.

    random_stateint or RandomState, optional

      Seed or random state for reproducible results. Defaults to None.

  Returns:
    pd.DataFrame

      DataFrame with generated data.