utils/kdd_parser.py
def label_str2num(self, str_label):
        """Convert string label into numerical label (either binary or one-hot)
        """
        if self.label_type == 'binary':
            return 0 if str_label == 'normal' else 1
        elif self.label_type == 'int':
            return category_str2int[str_label]
        elif self.label_type == 'one-hot':
            label = np.zeros((1, self.num_classes))
            index = category_str2int[str_label]
            label[0, index] = 1
            return label
Convert string label into numerical label (either binary or one-hot)
        
Convert string label into numerical label (either binary or one-hot)
Convert string label into numerical label ( either binary or one - hot )
def label_str2num(self, str_label):
        if self.label_type == 'binary':
            return 0 if str_label == 'normal' else 1
        elif self.label_type == 'int':
            return category_str2int[str_label]
        elif self.label_type == 'one-hot':
            label = np.zeros((1, self.num_classes))
            index = category_str2int[str_label]
            label[0, index] = 1
            return label
def label_str2num ( self , str_label ) : if self . label_type == 'binary' : return 0 if str_label == 'normal' else 1 elif self . label_type == 'int' : return category_str2int [ str_label ] elif self . label_type == 'one-hot' : label = np . zeros ( ( 1 , self . num_classes ) ) index = category_str2int [ str_label ] label [ 0 , index ] = 1 return label
Convert string label into numerical label (either binary or one-hot)
Convert string label into numerical label ( either binary or one - hot )
"""Convert string label into numerical label (either binary or one-hot)
        """
self
str_label