tools/utilities/pythonlibs/audio/classifier.py
def predict(self, feature_data):
        """ process the given feature_data using the classifier model, and smooth
        the output.  It returns a tuple containing (prediction, probability, label) """
        
        start_time = time.time()
        output = self.model.transform(feature_data)
        now = time.time()
        diff = now - start_time
        self.total_time += diff
        self.count += 1

        if self.logfile:
            self.logfile.write("{}\n".format(",".join([str(x) for x in output])))

        if self.smoothing_delay:
            output = self._smooth(output)
        
        prediction = self._get_prediction(output)
        if prediction and prediction not in self.ignore_list:
            label = ""
            if self.categories and prediction < len(self.categories):
                label = self.categories[prediction]
            return (prediction, output[prediction], label)

        return (None, None, None)
 process the given feature_data using the classifier model, and smooth
        the output.  It returns a tuple containing (prediction, probability, label) 
process the given feature_data using the classifier model, and smooth
the output.  It returns a tuple containing (prediction, probability, label)
process the given feature_data using the classifier model and smooth the output . It returns a tuple containing ( prediction probability label )
def predict(self, feature_data):
        start_time = time.time()
        output = self.model.transform(feature_data)
        now = time.time()
        diff = now - start_time
        self.total_time += diff
        self.count += 1
        if self.logfile:
            self.logfile.write("{}\n".format(",".join([str(x) for x in output])))
        if self.smoothing_delay:
            output = self._smooth(output)
        prediction = self._get_prediction(output)
        if prediction and prediction not in self.ignore_list:
            label = ""
            if self.categories and prediction < len(self.categories):
                label = self.categories[prediction]
            return (prediction, output[prediction], label)
        return (None, None, None)
def predict ( self , feature_data ) : start_time = time . time ( ) output = self . model . transform ( feature_data ) now = time . time ( ) diff = now - start_time self . total_time += diff self . count += 1 if self . logfile : self . logfile . write ( "{}\n" . format ( "," . join ( [ str ( x ) for x in output ] ) ) ) if self . smoothing_delay : output = self . _smooth ( output ) prediction = self . _get_prediction ( output ) if prediction and prediction not in self . ignore_list : label = "" if self . categories and prediction < len ( self . categories ) : label = self . categories [ prediction ] return ( prediction , output [ prediction ] , label ) return ( None , None , None )
process the given feature_data using the classifier model, and smooth
the output.
process the given feature_data using the classifier model and smooth the output .
""" process the given feature_data using the classifier model, and smooth
        the output.  It returns a tuple containing (prediction, probability, label) """
self
feature_data