tapas.threat_models.aia.AIALabeller
- class tapas.threat_models.aia.AIALabeller(attacker_knowledge: AttackerKnowledgeOnData, target_records: TabularRecord, sensitive_attribute: str, attribute_values: list, distribution: list = None)
Bases:
tapas.threat_models.attacker_knowledge.AttackerKnowledgeWithLabelReplace a record in the private dataset with a given target record, and randomly set the value of a given sensitive attribute in that record.
- __init__(attacker_knowledge: AttackerKnowledgeOnData, target_records: TabularRecord, sensitive_attribute: str, attribute_values: list, distribution: list = None)
Wrap an AttackerKnowledgeOnData object by appending a record with randomized sensitive attribute
- Parameters
attacker_knowledge (AttackerKnowledgeOnData) – The data knowledge from which datasets are generated.
target_records (Dataset) – The target records to add to the dataset with different sensitive attribute values. If this contains more than one record, the values for each record is sampled independently from all others.
sensitive_attribute (str) – The name of the attribute to randomise.
attribute_values (list) – All values that the attribute can take.
distribution (list (None as default)) – Distribution from which to sample attribute values, a list of real numbers in [0,1] which sums to 1. By default (None), the uniform distribution is used.
Methods
__init__(attacker_knowledge, target_records, ...)Wrap an AttackerKnowledgeOnData object by appending a record with randomized sensitive attribute
generate_datasets(num_samples[, training])Generate num_samples training or testing datasets.
generate_datasets_with_label(num_samples[, ...])Generate num_samples training or testing datasets with corresponding labels (arbitrary ints or bools).
Attributes
A string to represent this knowledge.
- abstract generate_datasets(num_samples: int, training: bool = True) list[Dataset]
Generate num_samples training or testing datasets.
- generate_datasets_with_label(num_samples: int, training: bool = True) tuple[list[Dataset], list[int]]
Generate num_samples training or testing datasets with corresponding labels (arbitrary ints or bools).
- property label
A string to represent this knowledge.