def checkme(y_true, y_pred, expected_auc):
    'Tests the ROC for a single set of predictions. Mostly sanity checks since all the computation is done\n        by scikit, which we assume is correct'
    roc = ROC.from_scores(y_true, y_pred)
    nose.tools.assert_almost_equal(roc.auc, expected_auc)
    nose.tools.ok_(all(((0 <= fpr_val <= 1) for fpr_val in roc.fpr)))
    nose.tools.ok_(all(((0 <= tpr_val <= 1) for tpr_val in roc.tpr)))
    nose.tools.assert_list_equal(list(roc.dataframe['tpr']), list(roc.tpr))
    nose.tools.assert_list_equal(list(roc.dataframe['thresholds']), list(roc.thresholds))
    for prop in ['fpr', 'tpr', 'thresholds']:
        nose.tools.assert_list_equal(list(roc.dataframe[prop]), list(getattr(roc, prop)))
        nose.tools.assert_greater_equal(len(roc.dataframe[prop]), 2)
Tests the ROC for a single set of predictions. Mostly sanity checks since all the computation is done
by scikit, which we assume is correct
def checkme(y_true, y_pred, expected_auc):
    'Tests the ROC for a single set of predictions. Mostly sanity checks since all the computation is done\n        by scikit, which we assume is correct'
    roc = ROC.from_scores(y_true, y_pred)
    nose.tools.assert_almost_equal(roc.auc, expected_auc)
    nose.tools.ok_(all(((0 <= fpr_val <= 1) for fpr_val in roc.fpr)))
    nose.tools.ok_(all(((0 <= tpr_val <= 1) for tpr_val in roc.tpr)))
    nose.tools.assert_list_equal(list(roc.dataframe['tpr']), list(roc.tpr))
    nose.tools.assert_list_equal(list(roc.dataframe['thresholds']), list(roc.thresholds))
    for prop in ['fpr', 'tpr', 'thresholds']:
        nose.tools.assert_list_equal(list(roc.dataframe[prop]), list(getattr(roc, prop)))
        nose.tools.assert_greater_equal(len(roc.dataframe[prop]), 2)