Ejemplo n.º 1
0
            auc50 = aucs[bg]['AUC50'][method]
            R.plot_roc_points(rocs, label=method, marker=markers[method], color=colors[method])
        R.plot_random_classifier(label='Random')
        R.label_plot()
        P.legend(loc='lower right')
        P.title('%s - %s' % (fragment_name(fragment), bg))
        P.savefig(os.path.join(options.results_dir, 'ROC-%s-%s.png' % (fragment, bg)))
        P.savefig(os.path.join(options.results_dir, 'ROC-%s-%s.eps' % (fragment, bg)))
        P.close()


        # precision-recall curves
        P.figure()
        for method in methods:
            rocs = [roc for roc, t in roc_thresholds[method]]
            R.plot_precision_versus_recall(rocs, label=method, marker=markers[method], color=colors[method])
        R.label_precision_versus_recall()
        P.legend(loc='lower left')
        P.title('%s - %s' % (fragment_name(fragment), bg))
        P.savefig(os.path.join(options.results_dir, 'Precision-Recall-%s-%s.png' % (fragment, bg)))
        P.savefig(os.path.join(options.results_dir, 'Precision-Recall-%s-%s.eps' % (fragment, bg)))
        P.close()

    # do AUC bar-chart
    #P.rcParams['xtick.direction'] = 'out'
    def x(a, b, m):
        return b*(len(methods)+1) + m
    P.figure(figsize=(14,6))
    for a, auc in enumerate(('AUC', 'AUC50')):
        ax = P.subplot(1, 2, a+1)
        xlocs = []
Ejemplo n.º 2
0
    P.figure()
    for method in methods:
        rocs = R.picked_rocs_from_thresholds(
            scores[(method,)],
            scores[(method, bg)],
            num_points=options.num_points
        )
        auc = R.area_under_curve(rocs)
        R.plot_roc_points(rocs, label='%.2f %s'%(auc,name(method)), marker=markers[method])
    R.plot_random_classifier(label='0.50 Random')
    R.label_plot()
    P.legend(loc='lower right')
    P.title('Full Sp1 - %s' % bg)
    P.savefig('ROC-Sp1-%s.png' % bg)
    P.savefig('ROC-Sp1-%s.eps' % bg)

    # precision-recall curves
    P.figure()
    for method in methods:
        rocs = R.picked_rocs_from_thresholds(
            scores[(method,)],
            scores[(method, bg)],
            num_points=options.num_points
        )
        R.plot_precision_versus_recall(rocs, label=name(method), marker=markers[method])
    R.label_precision_versus_recall()
    P.legend(loc='lower left')
    P.title('Full Sp1 - %s' % bg)
    P.savefig('Precision-Recall-Sp1-%s.png' % bg)
    P.savefig('Precision-Recall-Sp1-%s.eps' % bg)
Ejemplo n.º 3
0
        P.legend(loc='lower right')
        P.title('%s - %s' % (fragment_name(fragment), bg))
        P.savefig(
            os.path.join(options.results_dir,
                         'ROC-%s-%s.png' % (fragment, bg)))
        P.savefig(
            os.path.join(options.results_dir,
                         'ROC-%s-%s.eps' % (fragment, bg)))
        P.close()

        # precision-recall curves
        P.figure()
        for method in methods:
            rocs = [roc for roc, t in roc_thresholds[method]]
            R.plot_precision_versus_recall(rocs,
                                           label=method,
                                           marker=markers[method],
                                           color=colors[method])
        R.label_precision_versus_recall()
        P.legend(loc='lower left')
        P.title('%s - %s' % (fragment_name(fragment), bg))
        P.savefig(
            os.path.join(options.results_dir,
                         'Precision-Recall-%s-%s.png' % (fragment, bg)))
        P.savefig(
            os.path.join(options.results_dir,
                         'Precision-Recall-%s-%s.eps' % (fragment, bg)))
        P.close()

    # do AUC bar-chart
    #P.rcParams['xtick.direction'] = 'out'
    def x(a, b, m):
Ejemplo n.º 4
0
    P.figure()
    for method in methods:
        rocs = R.picked_rocs_from_thresholds(scores[(method, )],
                                             scores[(method, bg)],
                                             num_points=options.num_points)
        auc = R.area_under_curve(rocs)
        R.plot_roc_points(rocs,
                          label='%.2f %s' % (auc, name(method)),
                          marker=markers[method])
    R.plot_random_classifier(label='0.50 Random')
    R.label_plot()
    P.legend(loc='lower right')
    P.title('Full Sp1 - %s' % bg)
    P.savefig('ROC-Sp1-%s.png' % bg)
    P.savefig('ROC-Sp1-%s.eps' % bg)

    # precision-recall curves
    P.figure()
    for method in methods:
        rocs = R.picked_rocs_from_thresholds(scores[(method, )],
                                             scores[(method, bg)],
                                             num_points=options.num_points)
        R.plot_precision_versus_recall(rocs,
                                       label=name(method),
                                       marker=markers[method])
    R.label_precision_versus_recall()
    P.legend(loc='lower left')
    P.title('Full Sp1 - %s' % bg)
    P.savefig('Precision-Recall-Sp1-%s.png' % bg)
    P.savefig('Precision-Recall-Sp1-%s.eps' % bg)