pe.api.tabular.tabular_api module
- class pe.api.tabular.tabular_api.TabularAPI(info: dict, mutation_rate_init: float = 0.5, mutation_rate_final: float = 0.01, decay_type: str = 'polynomial', gamma: float = 0.2, num_iterations: int = 15)[source]
Bases:
APIThe tabular API that perturbs the original tabular data to generate variations of the synthetic data.
- __init__(info: dict, mutation_rate_init: float = 0.5, mutation_rate_final: float = 0.01, decay_type: str = 'polynomial', gamma: float = 0.2, num_iterations: int = 15)[source]
Constructor.
- Parameters:
info (dict) – The information (categories and numerical bounds) of the private data
mutation_rate_init (float, optional) – The initial mutation rate, defaults to 0.5
mutation_rate_final (float, optional) – The final mutation rate, defaults to 0.01
decay_type (str, optional) – The type of decay, defaults to “polynomial”
gamma (float, optional) – The gamma parameter for the polynomial decay, defaults to 0.2
num_iterations (int, optional) – The number of PE iterations, defaults to 15
- _get_mutation_rate(iteration) float[source]
Get the mutation rate for the given iteration.
- Parameters:
iteration (int) – The iteration
- Returns:
The mutation rate for the given iteration
- Return type:
float
- random_api(label_info, num_samples) Data[source]
Generating random synthetic data.
- Parameters:
label_info (omegaconf.dictconfig.DictConfig) – The info of the label
num_samples (int) – The number of random samples to generate
- Returns:
The data object of the generated synthetic data
- Return type:
- variation_api(syn_data) Data[source]
Generating variations of the synthetic data.
- Parameters:
syn_data (
pe.data.Data) – The data object of the synthetic data- Returns:
The data object of the variation of the input synthetic data
- Return type: