def test_attacker_advantage_perfect_classifier(self): roc = RocCurve( tpr=np.array([0.0, 1.0, 1.0]), fpr=np.array([1.0, 1.0, 0.0]), thresholds=np.array([0, 1, 2])) self.assertEqual(roc.get_auc(), 1.0)
def test_auc_random_classifier(self): roc = RocCurve( tpr=np.array([0.0, 0.5, 1.0]), fpr=np.array([0.0, 0.5, 1.0]), thresholds=np.array([0, 1, 2])) self.assertEqual(roc.get_auc(), 0.5)