4 simple customizable synthetic datasets from Chen et al., 2018 (L2X): Orange Skin, XOR, Non-linear Additive and Switch.
Project description
l2x_synthetic
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:
Project details
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for l2x_synthetic-2.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51e677b9055f72f9d3b7e0327472aa668ffb73e6b6d7b3bd3a3f3605b1eda4e6 |
|
MD5 | 1a36b2cdeff6a9e916f24b5686b0628c |
|
BLAKE2b-256 | 64d0d1a5a4308788e830606e7e32d00635fda7ba01784edefc57b7f36475a092 |