saving_factory — skchange

Skip to main content
`Ctrl`+`K`

# saving_factory

saving_factory(saving: str | tuple[Callable, Callable])

  Return saving function and its initializer.

  Parameters:
    saving{“mean”} or tuple[Callable, Callable], default=”mean”

      Name of saving function to use for anomaly detection.

      - “mean”: The Gaussian likelihood ratio saving of a maximum likelihod

          estimate of the mean versus a zero mean is used.

      - If a tuple, it must contain two numba jitted functions:

        > 1. The first function is the saving function, which takes three arguments:

        >    > 1. precomputed_params: The output of the second function.

        >    > 2. starts: Start indices of the intervals to calculate the saving for.

        >    > 3. ends: End indices of the intervals to calculate the saving for.

        > The algorithms that use the saving function govern what intervals are considered.

        > 2. The second function is the initializer, which takes the data matrix as input and returns precomputed quantities that may speed up the saving calculations. If not relevant, just return the input data matrix.

  Returns:
    saving_funcCallable

      Saving function.

    init_saving_funcCallable

      Saving function initializer.

  Raises:
    ValueError

      If saving is not recognized, an error is raised with a message indicating the valid options.