timesead.data.transforms.target_transforms ========================================== .. py:module:: timesead.data.transforms.target_transforms Classes ------- .. autoapisummary:: timesead.data.transforms.target_transforms.ReconstructionTargetTransform timesead.data.transforms.target_transforms.OneVsRestTargetTransform timesead.data.transforms.target_transforms.PredictionTargetTransform timesead.data.transforms.target_transforms.OverlapPredictionTargetTransform Module Contents --------------- .. py:class:: ReconstructionTargetTransform(parent: timesead.data.transforms.transform_base.Transform, replace_labels: bool = False) Bases: :py:obj:`timesead.data.transforms.transform_base.Transform` Adds the current inputs as targets for reconstruction objectives. :param parent: Another :class:`~timesead.data.transforms.Transform` which is used as the data source for this transform. :param replace_labels: Whether the original labels should be replaced by the reconstruction target. If `False`, the reconstruction target will be added to the tuple of original labels. .. py:attribute:: replace_labels :value: False .. py:class:: OneVsRestTargetTransform(parent: timesead.data.transforms.transform_base.Transform, normal_class: Optional[Any] = None, anomalous_class: Optional[Any] = None, replace_labels: bool = False) Bases: :py:obj:`timesead.data.transforms.transform_base.Transform` Transforms multi-class labels into binary labels for anomaly detection. "Normal" data points will have label 0, others will have label 1. :param parent: Another :class:`~timesead.data.transforms.Transform` which is used as the data source for this :class:`~timesead.data.transforms.Transform`. :param normal_class: The input class label that should be considered normal and will have label 0 in the output. :param anomalous_class: You can also specify an anomalous class that will have label 1. All other labels will be transformed to 0. Note that you cannot specify both `normal_class` and `anomalous_class`. :param replace_labels: Whether the original labels should be replaced by the :class:`~timesead.data.transforms.Transform`. If `False`, the additional labels will be added to the tuple of original labels. .. py:attribute:: replace_labels :value: False .. py:attribute:: normal_class :value: None .. py:attribute:: anomalous_class :value: None .. py:class:: PredictionTargetTransform(parent: timesead.data.transforms.transform_base.Transform, window_size: int, prediction_horizon: int, replace_labels: bool = False, step_size: int = 1, reverse: bool = False) Bases: :py:obj:`timesead.data.transforms.window_transform.WindowTransform` Adds the last `prediction_window` points from the current inputs as targets for prediction objectives. :param parent: Another :class:`~timesead.data.transforms.Transform` which is used as the data source for this :class:`~timesead.data.transforms.Transform`. :param prediction_horizon: Number of datapoints that should be predicted. :param replace_labels: Whether the original labels should be replaced by the prediction target. If `False`, the prediction target will be added to the tuple of original labels. .. py:attribute:: input_window_size .. py:attribute:: prediction_horizon .. py:attribute:: replace_labels :value: False .. py:property:: seq_len :type: Union[int, List[int]] This should return the length of each time series. If the time series have different lengths, the return value should be a list that contains the length of each sequence. If all sequences are of equal length, this should return an `int`. .. py:class:: OverlapPredictionTargetTransform(parent: timesead.data.transforms.transform_base.Transform, offset: int, replace_labels: bool = False) Bases: :py:obj:`timesead.data.transforms.transform_base.Transform` Adds the sequence shifted by offset as the target. :param parent: Another :class:`~timesead.data.transforms.Transform` which is used as the data source for this :class:`~timesead.data.transforms.Transform`. :param offset: Number of steps ahead that should be predicted. :param replace_labels: Whether the original labels should be replaced by the prediction target. If `False`, the prediction target will be added to the tuple of original labels. .. py:attribute:: offset .. py:attribute:: replace_labels :value: False .. py:property:: seq_len :type: Union[int, List[int]] This should return the length of each time series. If the time series have different lengths, the return value should be a list that contains the length of each sequence. If all sequences are of equal length, this should return an `int`.