Skip to main content

4 simple customizable synthetic datasets from Chen et al., 2018 (L2X): Orange Skin, XOR, Non-linear Additive and Switch.

Project description

l2x_synthetic

build status pypi badge

Exposes synthetic dataset generation code from L2X as a pip package. To install, run:

pip install l2x-synthetic

You can now create the synthetic datasets like:

from l2x_synthetic import XORGenerator
generator = XORGenerator(n_samples=100)
X, y = generator.get_data()

Which generates new data every time you call get_data() ✨. Use random_state to create reproducible data generation.

API

Available generators:

XORGenerator

from l2x_synthetic import XORGenerator

Orange Skin generator

from l2x_synthetic import OrangeGenerator

Non-linear additive generator

from l2x_synthetic import AdditiveGenerator

Switch generator: combines orange labels and non-linear additive

from l2x_synthetic import SwitchGenerator

Generator API

All generators are of the following type:

class l2x_synthetic.DataGenerator:
    name: str = None # contains a human-friendly name for the generator.
    n_samples: int = 100
    random_state: Optional[int] = None

    def get_data(self) -> Tuple[np.ndarray, np.ndarray]:
        ...

    def get_dataframe(self) -> pd.DataFrame:
        ...

Development dependencies

pip install -r requirements.txt

About

See the original repo:

https://github.com/Jianbo-Lab/L2X/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

l2x-synthetic-2.0.1.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

l2x_synthetic-2.0.1-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page