peal.data.dataset_generators.CircleDatasetGenerator

class peal.data.dataset_generators.CircleDatasetGenerator[source]

Bases: object

Generates dataset based on a unit circle of radius r

Methods

generate_dataset

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 dataset

  • dataset_origin_path (Path) – path to the directory where the dataset is stored

  • num_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) get Target = x2 > 0 and Confounder = x1 > 0; the four target/confounder cells are resampled to num_samples / 4 rows each and written to data.csv with columns x1,x2,Confounder,Target.

Returns:

self, with the generated array stored in self.data.

Return type:

CircleDatasetGenerator