tapas.attacks.base_classes.Attack

class tapas.attacks.base_classes.Attack

Bases: abc.ABC

Abstract base class for all privacy attacks.

This class defines (only) three common elements of attacks:

  • a .train method (that can be left empty), that selects parameters for the attack to make decisions.

  • a .attack method, that makes a binary decision for a (list of) dataset(s).

  • a .attack_score method that can be ignored if not meaningful, but can be useful for deeper analysis of attacks.

__init__()

Methods

__init__()

attack(datasets)

Perform the attack on each dataset in a list and return a (discrete) decision.

attack_score(datasets)

Perform the attack on each dataset in a list, but return a confidence score (specifically for classification tasks).

train(threat_model)

Train parameters of the attack.

Attributes

label

A label to describe this attack in reports.

abstract attack(datasets: list[Dataset])

Perform the attack on each dataset in a list and return a (discrete) decision.

abstract attack_score(datasets: list[Dataset])

Perform the attack on each dataset in a list, but return a confidence score (specifically for classification tasks).

property label

A label to describe this attack in reports.

abstract train(threat_model: ThreatModel)

Train parameters of the attack.