timesead.data.transforms.target_transforms
Classes
Adds the current inputs as targets for reconstruction objectives. |
|
Transforms multi-class labels into binary labels for anomaly detection. |
|
Adds the last prediction_window points from the current inputs as targets for prediction objectives. |
|
Adds the sequence shifted by offset as the target. |
Module Contents
- class timesead.data.transforms.target_transforms.ReconstructionTargetTransform(parent: timesead.data.transforms.transform_base.Transform, replace_labels: bool = False)
Bases:
timesead.data.transforms.transform_base.TransformAdds the current inputs as targets for reconstruction objectives.
- Parameters:
parent (timesead.data.transforms.transform_base.Transform) – Another
Transformwhich is used as the data source for this transform.replace_labels (bool) – 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.
- replace_labels = False
- class timesead.data.transforms.target_transforms.OneVsRestTargetTransform(parent: timesead.data.transforms.transform_base.Transform, normal_class: Any | None = None, anomalous_class: Any | None = None, replace_labels: bool = False)
Bases:
timesead.data.transforms.transform_base.TransformTransforms multi-class labels into binary labels for anomaly detection. “Normal” data points will have label 0, others will have label 1.
- Parameters:
parent (timesead.data.transforms.transform_base.Transform) – Another
Transformwhich is used as the data source for thisTransform.normal_class (Optional[Any]) – The input class label that should be considered normal and will have label 0 in the output.
anomalous_class (Optional[Any]) – 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.
replace_labels (bool) – Whether the original labels should be replaced by the
Transform. If False, the additional labels will be added to the tuple of original labels.
- replace_labels = False
- normal_class = None
- anomalous_class = None
- class timesead.data.transforms.target_transforms.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:
timesead.data.transforms.window_transform.WindowTransformAdds the last prediction_window points from the current inputs as targets for prediction objectives.
- Parameters:
parent (timesead.data.transforms.transform_base.Transform) – Another
Transformwhich is used as the data source for thisTransform.prediction_horizon (int) – Number of datapoints that should be predicted.
replace_labels (bool) – 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.
window_size (int)
step_size (int)
reverse (bool)
- input_window_size
- prediction_horizon
- replace_labels = False
- class timesead.data.transforms.target_transforms.OverlapPredictionTargetTransform(parent: timesead.data.transforms.transform_base.Transform, offset: int, replace_labels: bool = False)
Bases:
timesead.data.transforms.transform_base.TransformAdds the sequence shifted by offset as the target.
- Parameters:
parent (timesead.data.transforms.transform_base.Transform) – Another
Transformwhich is used as the data source for thisTransform.offset (int) – Number of steps ahead that should be predicted.
replace_labels (bool) – 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.
- offset
- replace_labels = False