Skip to main content

The SiD2ReGenerator Python project

Project description

SiD2ReGenerator

This package was developed to provide benchmark data for datadrift detection methods. Therefore, it is mostly concerned with generating data and the underlying concept and data shift ground truths used to evaluate the detection methods.

The main interface of the package is the class: DataGeneratorGraph, therefore the initialization and main methods will be explained here.

Benchmarks

For local generation of the SiD2Re benchmarks refer to the functions generate_benchmark_* found under sid2re.benchmarks.

  • benchmark_v1: Initial benchmark associated with the original publication (10.1109/INDIN51400.2023.10218255). Selected number of seeds, that produce interpretable concepts. Limited to low dimensionality datasets.
  • benchmark_v2: Benchmark with reworked graph based generation backend, that focuses on the variation of one particular concept (consistent seed). Suitable for ablation studies. Includes datasets with up to 20 dimensions.

Examples

For visualization the following script is used:

def plot_data(data):
    data = data.rename(columns={"0_0": "feature_1", "0_1": "feature_2", "O_0": "target"})
    # Get concept information
    time_stamps = data["time_idx"].values
    # Plot the generated data
    plot = sns.pairplot(data, height=2, aspect=4,
                        plot_kws=dict(hue=time_stamps, palette="blend:darkblue,orange", edgecolor=None,
                                      size=0.1, alpha=0.75),
                        diag_kind='kde', x_vars=["time_idx"], y_vars=["target", "feature_2", "feature_1"])
    plot = sns.pairplot(data, height=2, aspect=2,
                        plot_kws=dict(hue=time_stamps, palette="blend:darkblue,orange", edgecolor=None,
                                      size=0.1, alpha=0.75),
                        diag_kind='kde', x_vars=["feature_1", "feature_2"], y_vars=["target"])

Simple 2D Dataset: Uniform Features without Drifts

generator = DataGeneratorGraph(number_of_features=np.array([2]),
                               root_distros=[2, 0, 0, 0],
                               number_of_outputs=1,
                               n_target_dep=2,
                               number_of_data_points=500,
                               rand_seed=4)
# Generate data
data = generator.get_data()
plot_data(data)

Example_1_1.png Example_1_2.png

Periodical 2D Dataset (Continuous time)

generator = DataGeneratorGraph(number_of_features=np.array([2]),
                               root_distros=[0, 0, 0, 2],
                               number_of_outputs=1,
                               n_target_dep=2,
                               number_of_data_points=1000,
                               continuous_time=True,
                               rand_seed=3)

data = generator.get_data()

plot_data(data)

Example_2_1.png Example_2_2.png

Concept Drift

generator = DataGeneratorGraph(number_of_features=np.array([2]),
                               root_distros=[2, 0, 0, 0],
                               number_of_outputs=1,
                               n_target_dep=2,
                               concept_drifts=1,
                               number_of_data_points=1000,
                               continuous_time=True,
                               rand_seed=6)

data = generator.get_data()
concept_info, data_drift_info =generator.get_shift_information()
print(concept_info)
plot_data(data)

Output:

    time_stamp(centre)      radius                                               shift    class 
0           630.866645  250.245898   [-178.57203028720033, -66.39596106023545, -164...   sudden

Example_3_1.png Example_3_2.png

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

sid2regenerator-0.4.0.tar.gz (29.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sid2regenerator-0.4.0-py3-none-any.whl (37.5 kB view details)

Uploaded Python 3

File details

Details for the file sid2regenerator-0.4.0.tar.gz.

File metadata

  • Download URL: sid2regenerator-0.4.0.tar.gz
  • Upload date:
  • Size: 29.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.14 Linux/6.8.0-86-generic

File hashes

Hashes for sid2regenerator-0.4.0.tar.gz
Algorithm Hash digest
SHA256 1e3e2eb02d014556c41fe89b8d5bc6f43e9a8dd886faeb6c8f2c74d5937d3625
MD5 01791226501e4df5819e0fba2d1aeecc
BLAKE2b-256 dcf756cf2a01c92a8e5cececcdc6ef42336f91e545f4c4150f2a76436e116b89

See more details on using hashes here.

File details

Details for the file sid2regenerator-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: sid2regenerator-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 37.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.14 Linux/6.8.0-86-generic

File hashes

Hashes for sid2regenerator-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e6fa7b6d8d0c52a0f5f63efb6e0fc602324a4fa95693a5a10bbac906cf16c9b
MD5 07716274d55e76977089c6e3361e49a3
BLAKE2b-256 c136669a606d8d5c685f6a06d8124ff550bbc32c5ab490ba79dc440dfb9deab3

See more details on using hashes here.

Supported by

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