timesead.data.swat_dataset ========================== .. py:module:: timesead.data.swat_dataset Classes ------- .. autoapisummary:: timesead.data.swat_dataset.SWaTDataset Module Contents --------------- .. py:class:: SWaTDataset(path: str = os.path.join(DATA_DIRECTORY, 'SWaT', 'SWaT.A1 & A2_Dec 2015', 'Physical'), training: bool = True, standardize: Union[bool, Callable] = True, remove_startup: bool = True, preprocess: bool = True) Bases: :py:obj:`timesead.data.dataset.BaseTSDataset` Implementation of the Secure WAter Treatment Dataset [Goh2016]_. This dataset was recorded from a miniature water treatment plant over the course of several weeks. Both training and test set consist of a single long time series, each. During testing, several attacks (cyber and physical) were carried out against the plant. .. note:: Due to licensing issues, we cannot offer an automatic download option for this dataset. Please visit https://itrust.sutd.edu.sg/itrust-labs_datasets/dataset_info/ and fill in the form to request a download link. The required files are in the folder `SWaT.A1 & A2_Dec 2015/Physical`. .. warning:: This dataset relies on preprocessing to be done on the data. Preprocessing can be done by setting the `preprocess` argument to True. The class will fail giving an error without preprocessing. .. [Goh2016] Goh, Jonathan, et al. "A dataset to support research in the design of secure water treatment systems." Critical Information Infrastructures Security: 11th International Conference, CRITIS 2016, Paris, France, October 10–12, 2016, Revised Selected Papers 11. Springer International Publishing, 2017. :param path: Path where the files "SWaT_Dataset_Normal_v1.csv" and "SWaT_Dataset_Attack_v0.csv" are located. :param training: If True, this will load the training set consisting only of normal samples. Otherwise, loads the test set, which includes attacks. :param standardize: If True, apply min-max scaling (based on the training set). This can also be a function that accepts a DataFrame as its positional argument and a keyword argument `stats`: a dictionary of training data statistics. :param remove_startup: If True, this will remove the first 5 hours from the training set, as during this time the system was starting from an empty state. To be more exact, this removes only 4.5 hours, since the first 30 minutes were already removed in v1 of the Dataset. :param preprocess: If True, setup dataset to run experiments. .. py:attribute:: path .. py:attribute:: processed_dir .. py:attribute:: training :value: True .. py:attribute:: remove_startup :value: True .. py:attribute:: inputs :value: None .. py:attribute:: targets :value: None .. py:method:: load_data() -> Tuple[numpy.ndarray, numpy.ndarray] .. py:method:: __getitem__(item: int) -> Tuple[Tuple[torch.Tensor], Tuple[torch.Tensor]] .. py:method:: __len__() -> Optional[int] .. py:property:: seq_len :type: Optional[int] .. py:property:: num_features :type: int .. py:method:: get_default_pipeline() -> Dict[str, Dict[str, Any]] :staticmethod: .. py:method:: get_feature_names() :staticmethod: