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

        The features are log(totalSourceBytes), totalSourcePackets,
        and flow duration.

        :return: Tuple of data and labels as NumPy arrays.
        """
        self._logging.debug("Preparing data for SVM (RBF kernel) "
                            "DDoS attack classifier.")
        features = ["totalSourceBytes", "totalSourcePackets",
                    "startDateTime", "stopDateTime"]
        selected_data = self._return_features(self._raw_data, features)
        transformed_data = []
        for flow in selected_data:
            new_entry = []
            src_bytes = 0
            try:
                src_bytes = math.log(float(flow[0]))
            except ValueError:
                # Log (base 10) could not be evaluated, so set it to 0.
                # This has arisen as the number of source bytes is 0.
                # If the number of source bytes as listed in the
                # dataset is not 0, then something is wrong with the
                # data.
                pass
            new_entry.append(src_bytes)
            new_entry.append(flow[1])  # copy in totalSourcePackets
            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_svm_rbf classifier.

        The features are log(totalSourceBytes), totalSourcePackets,
        and flow duration.

        :return: Tuple of data and labels as NumPy arrays.
        
Prepare data for the ml_ddos_svm_rbf classifier.
The features are log(totalSourceBytes), totalSourcePackets,
and flow duration.
Prepare data for the ml_ddos_svm_rbf classifier . The features are log ( totalSourceBytes ) totalSourcePackets and flow duration .
def ddos_svm_rbf_data(self):
        self._logging.debug("Preparing data for SVM (RBF kernel) "
                            "DDoS attack classifier.")
        features = ["totalSourceBytes", "totalSourcePackets",
                    "startDateTime", "stopDateTime"]
        selected_data = self._return_features(self._raw_data, features)
        transformed_data = []
        for flow in selected_data:
            new_entry = []
            src_bytes = 0
            try:
                src_bytes = math.log(float(flow[0]))
            except ValueError:
                pass
            new_entry.append(src_bytes)
            new_entry.append(flow[1])  
            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_svm_rbf_data ( self ) : self . _logging . debug ( "Preparing data for SVM (RBF kernel) " "DDoS attack classifier." ) features = [ "totalSourceBytes" , "totalSourcePackets" , "startDateTime" , "stopDateTime" ] selected_data = self . _return_features ( self . _raw_data , features ) transformed_data = [ ] for flow in selected_data : new_entry = [ ] src_bytes = 0 try : src_bytes = math . log ( float ( flow [ 0 ] ) ) except ValueError : pass new_entry . append ( src_bytes ) new_entry . append ( flow [ 1 ] ) 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_svm_rbf classifier.
Prepare data for the ml_ddos_svm_rbf classifier .
"""Prepare data for the ml_ddos_svm_rbf classifier.

        The features are log(totalSourceBytes), totalSourcePackets,
        and flow duration.

        :return: Tuple of data and labels as NumPy arrays.
        """ # Log (base 10) could not be evaluated, so set it to 0. # This has arisen as the number of source bytes is 0. # If the number of source bytes as listed in the # dataset is not 0, then something is wrong with the # data. # copy in totalSourcePackets
Tuple of data and labels as NumPy arrays.
Tuple of data and labels as NumPy arrays .
self