Skip to content

dunnkers/l2x_synthetic

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

l2x_synthetic

build status pypi badge Downloads

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

Relevant features: [0, 1]

Orange Skin generator

from l2x_synthetic import OrangeGenerator

Relevant features: [0, 1, 2, 3]

Non-linear additive generator

from l2x_synthetic import AdditiveGenerator

Relevant features: [0, 1, 2, 3]

Switch generator: combines orange labels and non-linear additive

from l2x_synthetic import SwitchGenerator

Relevant features for X[:n//2] (first 1/2 of dataset): [0, 1, 2, 3]

Relevant features for X[n//2:] (second 1/2 of dataset): [4, 5, 6, 7]

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/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%