utils/kdd_parser.py
def convert_line(self, line):
        """Converts a line from the training or test data files into a numpy array for the
           design matrix and a label value
        """
        line = line.split(',')
        if len(line)-1 < self.num_features:
            #print >> sys.stderr, "WARNING: invalid line: {}".format(line)
            return None, None
        str_label = line[-1].replace('.','')
        label = self.label_str2num(str_label)
        line = line[0:-1]
        example = np.zeros((1, len(line)))
        for item, index in zip(line, range(len(line))):
            example[0,index] = self.feature_str2num(item, index)
        return example, label
Converts a line from the training or test data files into a numpy array for the
           design matrix and a label value
        
Converts a line from the training or test data files into a numpy array for the
design matrix and a label value
Converts a line from the training or test data files into a numpy array for the design matrix and a label value
def convert_line(self, line):
        line = line.split(',')
        if len(line)-1 < self.num_features:
            return None, None
        str_label = line[-1].replace('.','')
        label = self.label_str2num(str_label)
        line = line[0:-1]
        example = np.zeros((1, len(line)))
        for item, index in zip(line, range(len(line))):
            example[0,index] = self.feature_str2num(item, index)
        return example, label
def convert_line ( self , line ) : line = line . split ( ',' ) if len ( line ) - 1 < self . num_features : return None , None str_label = line [ - 1 ] . replace ( '.' , '' ) label = self . label_str2num ( str_label ) line = line [ 0 : - 1 ] example = np . zeros ( ( 1 , len ( line ) ) ) for item , index in zip ( line , range ( len ( line ) ) ) : example [ 0 , index ] = self . feature_str2num ( item , index ) return example , label
Converts a line from the training or test data files into a numpy array for the
design matrix and a label value
Converts a line from the training or test data files into a numpy array for the design matrix and a label value
"""Converts a line from the training or test data files into a numpy array for the
           design matrix and a label value
        """ #print >> sys.stderr, "WARNING: invalid line: {}".format(line)
self
line