Example #1
0
if __name__ == '__main__':
#    try:
        FILE_NAME = "data.dat"
        INIT_DATA_FILE_NAME = 'init.dat'
        TEST_FILE_NAME = "test_data.dat"
        TEST_INIT_DATA_FILE_NAME = 'test_init.dat'
#        binder.bind(str, annotated_with="data_file_name", to_instance = FILE_NAME)
#        binder.bind(str, annotated_with="init_file_name", to_instance = INIT_DATA_FILE_NAME)
        _init_log()
        dataProvider = DataProvider(FILE_NAME, INIT_DATA_FILE_NAME)
#        test_data = DataProvider(TEST_FILE_NAME, TEST_INIT_DATA_FILE_NAME).get_data()
#        assert(calc_class_re())
        app = QApplication(sys.argv)
        data = dataProvider.get_data()
#        print data
        classifier = c45(data, max_repeat_var=10)
        form = MainWindow(data, classifier)

##        print data
#        classifier = c45(data, max_repeat_var=10)
#        pos_sum = 0
#        for row, target in zip(data.data, data.target):
#            pos = 0
#            for l, c in classifier.get_labels_count(row).items():
#                pos += 1
#                if l == target:
#                    pos_sum += pos
#                    print pos
#            else:
#                print "=========="
#        print "---------------"
Example #2
0
def create_c45(step):
    world.c45 = c45(world.data_set)