Threshold Attack#
Run a simple threshold attack.
- class sacroml.attacks.threshold_attack.ThresholdAttack(output_dir: str = 'outputs', write_report: bool = True, signal: str = 'default')[source]#
Threshold attack.
Methods
attack(target)Check whether an attack can be performed and run the attack.
attackable(target)Return whether a target can be assessed with ThresholdAttack.
Get parameters for this attack.
- classmethod attackable(target: Target) bool[source]#
Return whether a target can be assessed with ThresholdAttack.
- __init__(output_dir: str = 'outputs', write_report: bool = True, signal: str = 'default') None[source]#
Construct an object to execute a worst case attack.
- Parameters:
- output_dirstr
Name of the directory where outputs are stored.
- write_reportbool
Whether to generate a JSON and PDF report.
- signalstr
Signal name, or
"default"for the task default ("logit"for classification,"log_mse"for regression).