Internal change.

PiperOrigin-RevId: 325768017
This commit is contained in:
A. Unique TensorFlower 2020-08-10 02:50:49 -07:00
parent 40419b56a3
commit 68651eeddc

View file

@ -196,33 +196,33 @@ class AttackResultsTest(absltest.TestCase):
self.assertEqual(results.get_result_with_max_attacker_advantage(), self.assertEqual(results.get_result_with_max_attacker_advantage(),
self.perfect_classifier_result) self.perfect_classifier_result)
@absltest.skip('Will be enabled in the next CL')
def test_summary_by_slices(self): def test_summary_by_slices(self):
results = AttackResults( results = AttackResults(
[self.perfect_classifier_result, self.random_classifier_result]) [self.perfect_classifier_result, self.random_classifier_result])
self.assertEqual( self.assertEqual(
results.summary(by_slices=True), 'Highest AUC on slice ' results.summary(by_slices=True),
'SingleSliceSpec' + 'Best-performing attacks over all slices\n' +
'(SlicingFeature.CORRECTLY_CLASSIFIED=True) achieved by ' + ' THRESHOLD_ATTACK achieved an AUC of 1.00 ' +
'AttackType.THRESHOLD_ATTACK with an AUC of 1.0\n' + 'on slice CORRECTLY_CLASSIFIED=True\n' +
'Highest advantage on ' + ' THRESHOLD_ATTACK achieved an advantage of 1.00 ' +
'slice SingleSliceSpec(SlicingFeature.CORRECTLY_CLASSIFIED=True) ' + 'on slice CORRECTLY_CLASSIFIED=True\n\n' +
'achieved by AttackType.THRESHOLD_ATTACK with an advantage of 1.0\n' + 'Best-performing attacks over slice: "CORRECTLY_CLASSIFIED=True"\n' +
'Highest AUC on slice SingleSliceSpec(Entire dataset) achieved ' + ' THRESHOLD_ATTACK achieved an AUC of 1.00\n' +
'by AttackType.THRESHOLD_ATTACK with an AUC of 0.5\n' + ' THRESHOLD_ATTACK achieved an advantage of 1.00\n\n' +
'Highest advantage on slice SingleSliceSpec(Entire dataset) achieved ' + 'Best-performing attacks over slice: "Entire dataset"\n' +
'by AttackType.THRESHOLD_ATTACK with an advantage of 0.0') ' THRESHOLD_ATTACK achieved an AUC of 0.50\n' +
' THRESHOLD_ATTACK achieved an advantage of 0.00')
@absltest.skip('Will be enabled in the next CL')
def test_summary_without_slices(self): def test_summary_without_slices(self):
results = AttackResults( results = AttackResults(
[self.perfect_classifier_result, self.random_classifier_result]) [self.perfect_classifier_result, self.random_classifier_result])
self.assertEqual( self.assertEqual(
results.summary(by_slices=False), results.summary(by_slices=False),
'Highest AUC on slice SingleSliceSpec(Entire dataset) achieved ' + 'Best-performing attacks over all slices\n' +
'by AttackType.THRESHOLD_ATTACK with an AUC of 0.5\n' + ' THRESHOLD_ATTACK achieved an AUC of 1.00 ' +
'Highest advantage on slice SingleSliceSpec(Entire dataset) achieved ' + 'on slice CORRECTLY_CLASSIFIED=True\n' +
'by AttackType.THRESHOLD_ATTACK with an advantage of 0.0') ' THRESHOLD_ATTACK achieved an advantage of 1.00 ' +
'on slice CORRECTLY_CLASSIFIED=True')
def test_save_load(self): def test_save_load(self):
results = AttackResults( results = AttackResults(