carclassifier.py
def train(self, features_train, labels_train, features_test,
              labels_test):
        """Trains the classifier with the supplied training data."""
        features_train = self.normalise(features_train)
        features_test = self.normalise(features_test)
        self.clf.fit(features_train, labels_train)

        start = time.time()
        test_set_accuracy = self.clf.score(features_test, labels_test)
        self.predict(features_test)
        end = time.time()

        print('Classifier test accuracy = ',
              round(test_set_accuracy, 4),
              '(took', round(end - start, 2), 'seconds on', len(features_test),
              'entries)')
Trains the classifier with the supplied training data.
Trains the classifier with the supplied training data.
Trains the classifier with the supplied training data .
def train(self, features_train, labels_train, features_test,
              labels_test):
        features_train = self.normalise(features_train)
        features_test = self.normalise(features_test)
        self.clf.fit(features_train, labels_train)
        start = time.time()
        test_set_accuracy = self.clf.score(features_test, labels_test)
        self.predict(features_test)
        end = time.time()
        print('Classifier test accuracy = ',
              round(test_set_accuracy, 4),
              '(took', round(end - start, 2), 'seconds on', len(features_test),
              'entries)')
def train ( self , features_train , labels_train , features_test , labels_test ) : features_train = self . normalise ( features_train ) features_test = self . normalise ( features_test ) self . clf . fit ( features_train , labels_train ) start = time . time ( ) test_set_accuracy = self . clf . score ( features_test , labels_test ) self . predict ( features_test ) end = time . time ( ) print ( 'Classifier test accuracy = ' , round ( test_set_accuracy , 4 ) , '(took' , round ( end - start , 2 ) , 'seconds on' , len ( features_test ) , 'entries)' )
Trains the classifier with the supplied training data.
Trains the classifier with the supplied training data .
"""Trains the classifier with the supplied training data."""
self
features_train
labels_train
features_test
labels_test