nmeta2dpae_datasets/iscx_2012_ddos_fold_1.py
def ddos_knn_data(self):
        """Prepare data for the ml_ddos_knn classifier.

        The features are totalSourceBytes, totalDestinationBytes,
        and flow duration.

        :return: Tuple of data and labels as NumPy arrays.
        """
        self._logging.debug("Preparing data for K Nearest Neighbours "
                            "DDoS attack classifier.")
        features = ["totalSourceBytes", "totalDestinationBytes",
                    "startDateTime", "stopDateTime"]
        selected_data = self._return_features(self._raw_data, features)
        transformed_data = []
        for flow in selected_data:
            new_entry = flow[0:2]  # copy in the first 2 elements
            start_dt = datetime.strptime(flow[2], "%Y-%m-%dT%H:%M:%S")
            stop_dt = datetime.strptime(flow[3], "%Y-%m-%dT%H:%M:%S")
            duration = (stop_dt-start_dt).seconds
            new_entry.append(duration)
            transformed_data.append(new_entry)
        return (np_array.array(transformed_data).astype(float32),
                np_array.array(self._raw_labels).astype(float32))
Prepare data for the ml_ddos_knn classifier.

        The features are totalSourceBytes, totalDestinationBytes,
        and flow duration.

        :return: Tuple of data and labels as NumPy arrays.
        
Prepare data for the ml_ddos_knn classifier.
The features are totalSourceBytes, totalDestinationBytes,
and flow duration.
Prepare data for the ml_ddos_knn classifier . The features are totalSourceBytes totalDestinationBytes and flow duration .
def ddos_knn_data(self):
        self._logging.debug("Preparing data for K Nearest Neighbours "
                            "DDoS attack classifier.")
        features = ["totalSourceBytes", "totalDestinationBytes",
                    "startDateTime", "stopDateTime"]
        selected_data = self._return_features(self._raw_data, features)
        transformed_data = []
        for flow in selected_data:
            new_entry = flow[0:2]  
            start_dt = datetime.strptime(flow[2], "%Y-%m-%dT%H:%M:%S")
            stop_dt = datetime.strptime(flow[3], "%Y-%m-%dT%H:%M:%S")
            duration = (stop_dt-start_dt).seconds
            new_entry.append(duration)
            transformed_data.append(new_entry)
        return (np_array.array(transformed_data).astype(float32),
                np_array.array(self._raw_labels).astype(float32))
def ddos_knn_data ( self ) : self . _logging . debug ( "Preparing data for K Nearest Neighbours " "DDoS attack classifier." ) features = [ "totalSourceBytes" , "totalDestinationBytes" , "startDateTime" , "stopDateTime" ] selected_data = self . _return_features ( self . _raw_data , features ) transformed_data = [ ] for flow in selected_data : new_entry = flow [ 0 : 2 ] start_dt = datetime . strptime ( flow [ 2 ] , "%Y-%m-%dT%H:%M:%S" ) stop_dt = datetime . strptime ( flow [ 3 ] , "%Y-%m-%dT%H:%M:%S" ) duration = ( stop_dt - start_dt ) . seconds new_entry . append ( duration ) transformed_data . append ( new_entry ) return ( np_array . array ( transformed_data ) . astype ( float32 ) , np_array . array ( self . _raw_labels ) . astype ( float32 ) )
Prepare data for the ml_ddos_knn classifier.
Prepare data for the ml_ddos_knn classifier .
"""Prepare data for the ml_ddos_knn classifier.

        The features are totalSourceBytes, totalDestinationBytes,
        and flow duration.

        :return: Tuple of data and labels as NumPy arrays.
        """ # copy in the first 2 elements
Tuple of data and labels as NumPy arrays.
Tuple of data and labels as NumPy arrays .
self