pysad.transform.probability_calibration.GaussianTailProbabilityCalibrator

class pysad.transform.probability_calibration.GaussianTailProbabilityCalibrator(running_statistics=True, window_size=6400)[source]

Assuming that the scores follow normal distribution, this class provides an interface to convert the scores into probabilities via Q-function, i.e., the tail function of Gaussian distribution [BALPA17].

Parameters:
  • running_statistics (bool) – Whether to calculate the mean and variance through running window. The window size is defined by the window_size parameter.

  • window_size (int) – The size of window for running average and std. Ignored if running_statistics parameter is False.

Methods

__init__([running_statistics, window_size])

fit(scores)

Shortcut method that iteratively applies fit_partial to all instances in order.

fit_partial(score)

Fits particular (next) timestep's score to train the postprocessor.

fit_transform(scores)

Shortcut method that iteratively applies fit_transform_partial to all instances in order.

fit_transform_partial(score)

Shortcut method that iteratively applies fit_partial and transform_partial, respectively.

transform(scores)

Shortcut method that iteratively applies transform_partial to all instances in order.

transform_partial(score)

Transforms given score.

fit(scores)

Shortcut method that iteratively applies fit_partial to all instances in order.

Parameters:

shape (np.float64 array of) – Input scores.

Returns:

self.

Return type:

object

fit_partial(score)[source]

Fits particular (next) timestep’s score to train the postprocessor.

Parameters:

score (float) – Input score.

Returns:

self.

Return type:

object

fit_transform(scores)

Shortcut method that iteratively applies fit_transform_partial to all instances in order.

Parameters:

shape (np.float64 array of) – Input scores.

Returns:

Processed scores.

Return type:

np.float64 array of shape (num_instances,)

fit_transform_partial(score)

Shortcut method that iteratively applies fit_partial and transform_partial, respectively.

Parameters:

score (float) – Input score.

Returns:

Processed score.

Return type:

float

transform(scores)

Shortcut method that iteratively applies transform_partial to all instances in order.

Parameters:

shape (np.float64 array of) – Input scores.

Returns:

Processed scores.

Return type:

np.float64 array of shape (num_instances,)

transform_partial(score)[source]

Transforms given score.

Parameters:

score (float) – Input score.

Returns:

Processed score.

Return type:

float