iguanas.metrics.unsupervised.AlertsPerDay

class iguanas.metrics.unsupervised.AlertsPerDay(n_alerts_expected_per_day: int, no_of_days_in_file: int)[source]

Calculates the negative squared difference between the number of alerts per day in the binary predictor(s) vs the expected.

Parameters
n_alerts_expected_per_dayint

Expected number of alerts for the given rule.

no_of_days_in_fileint

Number of days of data provided in the file.

fit(y_preds: Union[iguanas.utils.typing.numpy.ndarray, iguanas.utils.typing.pandas.core.series.Series, iguanas.utils.typing.databricks.koalas.series.Series, iguanas.utils.typing.pandas.core.frame.DataFrame, iguanas.utils.typing.databricks.koalas.frame.DataFrame]) Union[float, iguanas.utils.typing.numpy.ndarray][source]

Calculates the negative squared difference between the number of alerts per day in the binary predictor(s) vs the expected.

Parameters
y_predsUnion[NumpyArrayType, PandasSeriesType, KoalasSeriesType, PandasDataFrameType, KoalasDataFrameType]

The binary predictor column(s).

Returns
Union[float, NumpyArrayType]

The negative squared difference(s).