Esempio n. 1
0
def print_results(clf_scores, micro, macro, r2_all, mse_all, mrse_all):
    metric_means = np.mean(clf_scores, axis=0)
    metric_ci = hci(clf_scores, .95, axis=0)

    print(clf_summary(metric_means, metric_ci))
    print('Micro F1 - mean: %f +- %f' % (np.mean(micro), hci(micro, .95)))
    print('Macro F1 - mean: %f +- %f' % (np.mean(macro), hci(macro, .95)))
    print('R2 all   - mean: %f +- %f' % (np.mean(r2_all), hci(r2_all, .95)))
    print('MSE all   - mean: %f +- %f' % (np.mean(mse_all), hci(mse_all, .95)))
    print('MRSE all   - mean: %f +- %f' %
          (np.mean(mrse_all), hci(mrse_all, .95)))
Esempio n. 2
0
def print_results(clf_scores, micro, macro, r2_all, mse_all, mrse_all):
    metric_means = np.mean(clf_scores, axis=0)
    metric_ci = hci(clf_scores, .95, axis=0)
    
    print(clf_summary(metric_means, metric_ci))
    print('Micro F1 - mean: %f +- %f' % (np.mean(micro), hci(micro, .95)))
    print('Macro F1 - mean: %f +- %f' % (np.mean(macro), hci(macro, .95)))
    print('R2 all   - mean: %f +- %f' % (np.mean(r2_all), hci(r2_all, .95)))
    print('MSE all   - mean: %f +- %f' % (np.mean(mse_all), hci(mse_all, .95)))
    print('MRSE all   - mean: %f +- %f' % (np.mean(mrse_all), 
                                           hci(mrse_all, .95)))
Esempio n. 3
0
def main(features_fpath, tseries_fpath, tags_fpath, classes_fpath, clf_name):
    X, params = create_input_table(features_fpath, tseries_fpath, tags_fpath)
    y = np.loadtxt(classes_fpath)

    clf = create_grid_search(clf_name)
    class_matrices, conf_matrices = run_classifier(clf, X, y)

    metric_means = np.mean(class_matrices, axis=0)
    metric_ci = hci(class_matrices, .95, axis=0)
    print(clf_summary(metric_means, metric_ci))
    print()

    conf_means = np.mean(conf_matrices, axis=0)
    conf_ci = hci(conf_matrices, .95, axis=0)
    print("Average confusion matrix with .95 confidence interval")
    print(" \ttrue ")
    print("predic")
    for i in range(conf_means.shape[0]):
        print(i, end="\t \t")
        for j in range(conf_means.shape[1]):
            print('%.3f +- %.3f' % (conf_means[i, j], conf_ci[i, j]), end="\t")
        print()
Esempio n. 4
0
def main(features_fpath, tseries_fpath, tags_fpath, classes_fpath, clf_name):
    X, params = create_input_table(features_fpath, tseries_fpath, tags_fpath)
    y = np.loadtxt(classes_fpath)
    
    clf = create_grid_search(clf_name)
    class_matrices, conf_matrices = run_classifier(clf, X, y)
    
    metric_means = np.mean(class_matrices, axis=0)
    metric_ci = hci(class_matrices, .95, axis=0)
    print(clf_summary(metric_means, metric_ci))
    print()
    
    conf_means = np.mean(conf_matrices, axis=0)
    conf_ci = hci(conf_matrices, .95, axis=0)
    print("Average confusion matrix with .95 confidence interval")
    print(" \ttrue ")
    print("predic")
    for i in xrange(conf_means.shape[0]):
        print(i, end="\t \t")
        for j in xrange(conf_means.shape[1]):
            print('%.3f +- %.3f' % (conf_means[i, j], conf_ci[i, j]), end="\t")
        print()