<commit_before>'''
Created on 28 Jun 2014

@author: heiko
'''
from seizures.evaluation.ToyXValidationData import ToyXValidationData
from seizures.evaluation.XValidation import XValidation
from seizures.prediction.ForestPredictor import ForestPredictor
from seizures.prediction.RandomPredictor import RandomPredictor
from seizures.prediction.SVMPredictor import SVMPredictor


def test_predictor(predictor_cls):
    predictor = predictor_cls()

    X_list, y_list = ToyXValidationData.get()

    print XValidation.evaluate(X_list, y_list, predictor)

if __name__ == '__main__':
#     print "RandomPredictor"
#     test_predictor(RandomPredictor)
# # 
    print "ForestPredictor"
    test_predictor(ForestPredictor)
# 
#     print "SVMPredictor"
#     test_predictor(SVMPredictor)<commit_msg>test all classifiers in x-validation<commit_after>'''
Created on 28 Jun 2014

@author: heiko
'''
from seizures.evaluation.ToyXValidationData import ToyXValidationData
from seizures.evaluation.XValidation import XValidation
from seizures.prediction.ForestPredictor import ForestPredictor
from seizures.prediction.RandomPredictor import RandomPredictor
from seizures.prediction.SVMPredictor import SVMPredictor


def test_predictor(predictor_cls):
    predictor = predictor_cls()

    X_list, y_list = ToyXValidationData.get()

    print XValidation.evaluate(X_list, y_list, predictor)

if __name__ == '__main__':
    print "RandomPredictor"
    test_predictor(RandomPredictor)

    print "ForestPredictor"
    test_predictor(ForestPredictor)
 
    print "SVMPredictor"
    test_predictor(SVMPredictor)
{'fraction_non_alphanumeric': 0.0729559748427673, 'fraction_numerical': 0.007547169811320755, 'mean_word_length': 5.799145299145299, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6739272', 'n_tokens_mistral': 536, 'n_tokens_neox': 471, 'n_words': 105}