Esempio n. 1
0
 def test_submission(self):
     train_data = extract_features(load_adult_train_data())
     valid_data = extract_features(load_adult_valid_data())
     model = submission(train_data)
     predictions = [predict(model, p) for p in train_data]
     print
     print
     print "Training Accuracy:", accuracy(train_data, predictions)
     predictions = [predict(model, p) for p in valid_data]
     print "Validation Accuracy:", accuracy(valid_data, predictions)
     print
Esempio n. 2
0
 def test_submission(self):
     train_data = extract_features(load_adult_train_data())
     valid_data = extract_features(load_adult_valid_data())
     model = submission(train_data)
     predictions = [predict(model, p) for p in train_data]
     print()
     print()
     print("Training Accuracy:", accuracy(train_data, predictions))
     predictions = [predict(model, p) for p in valid_data]
     print("Validation Accuracy:", accuracy(valid_data, predictions))
     print()
 def test_submission(self):
     """Overall test.
     """
     train_data = extract_features(load_adult_train_data())
     valid_data = extract_features(load_adult_valid_data())
     model = submission(train_data)
     predictions = [predict(model, p) for p in train_data]
     print("Training Accuracy: {0}".format(
         accuracy(train_data, predictions)))
     predictions = [predict(model, p) for p in valid_data]
     print("Validation Accuracy: {0}".format(
         accuracy(valid_data, predictions)))