SiD2ReGenerator


NameSiD2ReGenerator JSON
Version 0.2.14 PyPI version JSON
download
home_pagehttps://github.com/FraunhoferIOSB/SiD2Re
SummaryThe SiD2ReGenerator Python project
upload_time2024-10-17 08:41:27
maintainerB. Stratmann
docs_urlNone
authorB. Stratmann
requires_python<3.12,>=3.8
licenseBSD-3-Clause
keywords tool ml
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

# Examples
For visualization the following script is used:
```python
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
```python
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](./README_Assets/Example_1_1.png)
![Example_1_2.png](./README_Assets/Example_1_2.png)

## Periodical 2D Dataset (Continuous time)
```python
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](./README_Assets/Example_2_1.png)
![Example_2_2.png](./README_Assets/Example_2_2.png)


## Concept Drift 

```python
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](./README_Assets/Example_3_1.png)
![Example_3_2.png](./README_Assets/Example_3_2.png)



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/FraunhoferIOSB/SiD2Re",
    "name": "SiD2ReGenerator",
    "maintainer": "B. Stratmann",
    "docs_url": null,
    "requires_python": "<3.12,>=3.8",
    "maintainer_email": "benedikt.stratmann@iosb.fraunhofer.de",
    "keywords": "tool, ml",
    "author": "B. Stratmann",
    "author_email": "benedikt.stratmann@iosb.fraunhofer.de",
    "download_url": "https://files.pythonhosted.org/packages/e6/f8/20830cb37932d19d728bdbf4d45e83165c40476dcd97cd4110b0595088f8/sid2regenerator-0.2.14.tar.gz",
    "platform": null,
    "description": "# SiD2ReGenerator\n\nThis package was developed to provide benchmark data for datadrift detection methods.\nTherefore, it is mostly concerned with generating data and the underlying concept and data shift ground truths used to evaluate the detection methods.\n\nThe main interface of the package is the class: DataGeneratorGraph, therefore the initialization and main methods will be explained here.\n# Benchmarks\n\nFor local generation of the SiD2Re benchmarks refer to the functions generate_benchmark_* found under sid2re.benchmarks\n\n# Examples\nFor visualization the following script is used:\n```python\ndef plot_data(data):\n    data = data.rename(columns={\"0_0\": \"feature_1\", \"0_1\": \"feature_2\", \"O_0\": \"target\"})\n    # Get concept information\n    time_stamps = data[\"time_idx\"].values\n    # Plot the generated data\n    plot = sns.pairplot(data, height=2, aspect=4,\n                        plot_kws=dict(hue=time_stamps, palette=\"blend:darkblue,orange\", edgecolor=None,\n                                      size=0.1, alpha=0.75),\n                        diag_kind='kde', x_vars=[\"time_idx\"], y_vars=[\"target\", \"feature_2\", \"feature_1\"])\n    plot = sns.pairplot(data, height=2, aspect=2,\n                        plot_kws=dict(hue=time_stamps, palette=\"blend:darkblue,orange\", edgecolor=None,\n                                      size=0.1, alpha=0.75),\n                        diag_kind='kde', x_vars=[\"feature_1\", \"feature_2\"], y_vars=[\"target\"])\n```\n## Simple 2D Dataset: Uniform Features without Drifts\n```python\ngenerator = DataGeneratorGraph(number_of_features=np.array([2]),\n                               root_distros=[2, 0, 0, 0],\n                               number_of_outputs=1,\n                               n_target_dep=2,\n                               number_of_data_points=500,\n                               rand_seed=4)\n# Generate data\ndata = generator.get_data()\nplot_data(data)\n```\n\n![Example_1_1.png](./README_Assets/Example_1_1.png)\n![Example_1_2.png](./README_Assets/Example_1_2.png)\n\n## Periodical 2D Dataset (Continuous time)\n```python\ngenerator = DataGeneratorGraph(number_of_features=np.array([2]),\n                               root_distros=[0, 0, 0, 2],\n                               number_of_outputs=1,\n                               n_target_dep=2,\n                               number_of_data_points=1000,\n                               continuous_time=True,\n                               rand_seed=3)\n\ndata = generator.get_data()\n\nplot_data(data)\n```\n\n![Example_2_1.png](./README_Assets/Example_2_1.png)\n![Example_2_2.png](./README_Assets/Example_2_2.png)\n\n\n## Concept Drift \n\n```python\ngenerator = DataGeneratorGraph(number_of_features=np.array([2]),\n                               root_distros=[2, 0, 0, 0],\n                               number_of_outputs=1,\n                               n_target_dep=2,\n                               concept_drifts=1,\n                               number_of_data_points=1000,\n                               continuous_time=True,\n                               rand_seed=6)\n\ndata = generator.get_data()\nconcept_info, data_drift_info =generator.get_shift_information()\nprint(concept_info)\nplot_data(data)\n```\nOutput:\n```\n    time_stamp(centre)      radius                                               shift    class \n0           630.866645  250.245898   [-178.57203028720033, -66.39596106023545, -164...   sudden\n\n```\n\n\n![Example_3_1.png](./README_Assets/Example_3_1.png)\n![Example_3_2.png](./README_Assets/Example_3_2.png)\n\n\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "The SiD2ReGenerator Python project",
    "version": "0.2.14",
    "project_urls": {
        "Homepage": "https://github.com/FraunhoferIOSB/SiD2Re",
        "Repository": "https://github.com/FraunhoferIOSB/SiD2Re"
    },
    "split_keywords": [
        "tool",
        " ml"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d0cd6f97f0171feaf4bd4162fdf538c500b2f3ad14284e63748c1a3a5382e35f",
                "md5": "7cc39caf6206330daf2af3451056a81e",
                "sha256": "eeeec9d559a8d940733bf7bf7537943f0468c0599bf38e972bc989fda79c6afe"
            },
            "downloads": -1,
            "filename": "sid2regenerator-0.2.14-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7cc39caf6206330daf2af3451056a81e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.12,>=3.8",
            "size": 33280,
            "upload_time": "2024-10-17T08:41:26",
            "upload_time_iso_8601": "2024-10-17T08:41:26.757780Z",
            "url": "https://files.pythonhosted.org/packages/d0/cd/6f97f0171feaf4bd4162fdf538c500b2f3ad14284e63748c1a3a5382e35f/sid2regenerator-0.2.14-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e6f820830cb37932d19d728bdbf4d45e83165c40476dcd97cd4110b0595088f8",
                "md5": "6e13878876fd4517f1d0a969f7a08967",
                "sha256": "0c000feac7e2d08f08f7c341333271b6fb8cd4ecb99515cef9993bfe84565fe7"
            },
            "downloads": -1,
            "filename": "sid2regenerator-0.2.14.tar.gz",
            "has_sig": false,
            "md5_digest": "6e13878876fd4517f1d0a969f7a08967",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.12,>=3.8",
            "size": 25608,
            "upload_time": "2024-10-17T08:41:27",
            "upload_time_iso_8601": "2024-10-17T08:41:27.992388Z",
            "url": "https://files.pythonhosted.org/packages/e6/f8/20830cb37932d19d728bdbf4d45e83165c40476dcd97cd4110b0595088f8/sid2regenerator-0.2.14.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-17 08:41:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "FraunhoferIOSB",
    "github_project": "SiD2Re",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "sid2regenerator"
}
        
Elapsed time: 0.49017s