timesead.data.transforms.artificial_anomalies ============================================= .. py:module:: timesead.data.transforms.artificial_anomalies Classes ------- .. autoapisummary:: timesead.data.transforms.artificial_anomalies.InjectArtificialAnomaliesTransform timesead.data.transforms.artificial_anomalies.InjectIndependentArtificialAnomaliesTransform timesead.data.transforms.artificial_anomalies.InjectWindowsArtificialAnomaliesTransform Module Contents --------------- .. py:class:: InjectArtificialAnomaliesTransform(parent: timesead.data.transforms.transform_base.Transform, n: int, min_length: int = 1, max_length: int = 1) Bases: :py:obj:`timesead.data.transforms.transform_base.Transform` This Transform injects anomalies into the dataset. It expects the get_datapoint method of its parent to return a tuple of tuples of length 1. :param parent: Another :class:`~timesead.data.transforms.Transform` which is used as the data source for this :class:`~timesead.data.transforms.Transform`. :param n: Number of anomalies to insert. :param min_length: Minimum length of anomalies. :param max_length: Maximum length of anomalies. .. py:class:: InjectIndependentArtificialAnomaliesTransform(parent: timesead.data.transforms.transform_base.Transform, anomaly_fn: Callable, n: int, min_length: int = 1, max_length: int = 1) Bases: :py:obj:`InjectArtificialAnomaliesTransform` Transform that injects anomalies, that only depend on the anomaly interval. :param parent: Another :class:`~timesead.data.transforms.Transform` which is used as the data source for this :class:`~timesead.data.transforms.Transform`. :param anomaly_fn: Callable that adds an anomaly to an interval and returns a :class:`torch.Tensor` of the same size as its input. :param n: Number of anomalies to insert. :param min_length: Minimum length of anomalies. :param max_length: Maximum length of anomalies. .. py:attribute:: anomaly .. py:class:: InjectWindowsArtificialAnomaliesTransform(parent: timesead.data.transforms.transform_base.Transform, mask_fn: Callable, n: int, min_length: int = 1, max_length: int = 1) Bases: :py:obj:`InjectArtificialAnomaliesTransform` :class:`~timesead.data.transforms.Transform` that inject windows from somewhere else in the dataset as anomalies. :param parent: Another :class:`~timesead.data.transforms.Transform` which is used as the data source for this :class:`~timesead.data.transforms.Transform`. :param mask_fn: Callable that computes a mask to the features of an interval. :param n: Number of anomalies to insert. :param min_length: Minimum length of anomalies. :param max_length: Maximum length of anomalies. .. py:attribute:: mask