def main():
    args = arg.preprocess_args()
    rand = 0
    data, _ = helper.pre_processed_data_all(args, rand, dry=False)
    if args.mean:
        rand = random.randint(0, 9999999)
        label, _ = helper.pre_processed_label_all(args, rand, dry=False)
        data = preprocess.mean_image(label, data)
    helper.create_images_from_rows((args.name or 'img'), data)
Beispiel #2
0
def server():
    args = rForest_args()
    rand = np.random.randint(10000000)
    data_train, data_test = pre_processed_data_all(args, rand)
    label_train, label_test = pre_processed_label_all(args, rand)
    res = []
    for i in range(2, 6):
        print('===\,n=====Epochs: %d=====\n===' % i)
        res.append(
            run_function(random_forest,
                         args.cross_validate,
                         data_train,
                         label_train,
                         data_test,
                         label_test,
                         max_depth=i + 1))
    print(res)
    res = extract_measures(res)
    print(res)
    plot_experiment('random_forest_test_9000', 'n estimator', res)
def server():
    args = rForest_args()
    rand = np.random.randint(10000000)
    data_train, data_test = pre_processed_data_all(args, rand)
    label_train, label_test = pre_processed_label_all(args, rand)
    res = []
    for i in range(5):
        print('===\n=====Epochs: %d=====\n===' % i)
        res.append(
            run_function(linear_classifier,
                         args.cross_validate,
                         data_train,
                         label_train,
                         data_test,
                         label_test,
                         max_iter=(i + 1)))
    print(res)
    res = extract_measures(res)
    print(res)
    plot_experiment('linear_classifier_test', 'max iteration ( x 100)', res)
Beispiel #4
0
def main():
    args = keras_args()
    rand = np.random.randint(10000000)
    data_train, data_test = helper.pre_processed_data_all(args, rand)
    label_train, label_test = helper.pre_processed_label_all(args, rand)
    res = []
    for i in range(10, 25):
        print('===\n=====Epochs: %d=====\n===' % i)
        resa = []
        for j in range(5):
            resa.append(helper.run_function(keras_build_and_predict,
                                            args.cross_validate,
                                            data_train, label_train,
                                            data_test, label_test,
                                            epochs=i))
        res.append(helper.mean_measures(helper.extract_measures(resa)))
    print(res)
    res = helper.extract_measures(res)
    print(res)
    helper.plot_experiment_server('research', 'epochs', res)
Beispiel #5
0
def main():
    args = arg.preprocess_args()
    rand = random.randint(0, 9999999)
    data, _ = helper.pre_processed_data_all(args, rand, dry=False)
    if args.mean:
        label, _ = helper.pre_processed_label_all(args, rand, dry=False)
        data = preprocess.mean_image(label, data)
    elif args.split is not None or args.randomize:
        label, _ = helper.pre_processed_label(args, rand, dry=False)
        helper.write_data_to_file(
            (args.folder or helper.FOLDER) + (args.name or 'processed_data') +
            '_l' + helper.EXT,
            label,
            fmt='%d',
            h='0')
    # for i in range(4):
    #     for j in range(4):
    helper.write_data_to_file((args.folder or helper.FOLDER) +
                              (args.name or 'processed_data') + helper.EXT,
                              data,
                              h=', '.join(str(i) for i in range(len(data[0]))))
Beispiel #6
0
def j48_depth(options):
    args = j48_args(options).parse_args(options[1:])
    rand = np.random.randint(10000000)
    data_train, data_test = pre_processed_data_all(args, rand)
    label_train, label_test = pre_processed_label_all(args, rand)
    res = []
    for i in range(24):
        print('===\n=====Epochs: %d=====\n===' % i)
        res.append(
            run_function(j48,
                         args.cross_validate,
                         data_train,
                         label_train,
                         data_test,
                         label_test,
                         depth=i,
                         min_split=2,
                         min_leaf=1,
                         min_weight=0))
    print(res)
    res = extract_measures(res)
    print(res)
    plot_experiment_server("j48_" + options[0] + "max_depth", 'max depth', res)