peal.data.dataset_generators.CircleDatasetGenerator¶
- class peal.data.dataset_generators.CircleDatasetGenerator[source]¶
Bases:
objectGenerates dataset based on a unit circle of radius r
Methods
Generates the dataset.
- __init__(config=None, dataset_name=None, dataset_origin_path='datasets', num_samples=1024, radius=1, noise_scale=0.0, seed=0, **kwargs)[source]¶
Initiates the dataset parameters
- Parameters:
dataset_name (
str) – Name of the datasetdataset_origin_path (
Path) – path to the directory where the dataset is storednum_samples (
int, optional) – Number of samples to generate. Default is 1024.noise_scale (
float, optional) – The value with which to scale the variance (set to 1 initially) of the noise. Default is 0.0 (no noise).seed (
int, optional) – Seed for the random number generator. Defaults is 0.
- generate_dataset()[source]¶
Generates the dataset.
Points on a circle of
radius(plus Gaussian noise) getTarget = x2 > 0andConfounder = x1 > 0; the four target/confounder cells are resampled tonum_samples / 4rows each and written todata.csvwith columnsx1,x2,Confounder,Target.- Returns:
self, with the generated array stored inself.data.- Return type: