niaarmts


Nameniaarmts JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryTime series numerical association rule mining variants
upload_time2024-10-24 13:00:39
maintainerNone
docs_urlNone
authorIztok Fister Jr.
requires_python<3.13,>=3.12
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center">
    Nature-Inspired Algorithms for Time Series Numerical Association Rule Mining
</h1>

<p align="center">
    <a href="#-features">✨ Features</a> β€’
    <a href="#-installation">πŸ“¦ Installation</a> β€’
    <a href="#-basic-example">πŸš€ Basic example</a> β€’
    <a href="#-reference-papers">πŸ“š Reference Papers</a> β€’
    <a href="#-license">πŸ”‘ License</a> β€’
    <a href="#-cite-us">πŸ“„ Cite us</a>
</p>

This framework is designed for **numerical association rule mining in time series data** using **stochastic population-based nature-inspired algorithms**[^1]. It provides tools to extract association rules from time series datasets while incorporating key metrics such as **support**, **confidence**, **inclusion**, and **amplitude**. Although independent from the NiaARM framework, this software can be viewed as an extension, with additional support for time series numerical association rule mining.

## ✨ Features

The current version of the framework supports two types of time series numerical association rule mining:

- **Fixed Interval Time Series Numerical Association Rule Mining**
- **Segmented Interval Time Series Numerical Association Rule Mining**

## πŸ“¦ Installation

To install `NiaARMTS` with pip, use:

```sh
pip install niaarmts
```

## πŸš€ Basic example

```python
from niapy.algorithms.basic import ParticleSwarmAlgorithm
from niapy.task import Task
from niaarmts import Dataset
from niaarmts.NiaARMTS import NiaARMTS

# Load dataset
dataset = Dataset()
dataset.load_data_from_csv('ts.csv', timestamp_col='timestamp')

# Create an instance of NiaARMTS
niaarmts_problem = NiaARMTS(
    dimension=dataset.calculate_problem_dimension(),  # Adjust dimension dynamically
    lower=0.0,  # Lower bound of solution space
    upper=1.0,  # Upper bound of solution space
    features=dataset.get_all_features_with_metadata(),  # Pass feature metadata
    transactions=dataset.get_all_transactions(),  # Dataframe containing all transactions
    interval='false',  # Whether we're dealing with interval data
    alpha=1.0,  # Weight for support in fitness calculation
    beta=1.0,  # Weight for confidence in fitness calculation
    gamma=1.0,  # Weight for inclusion in fitness calculation # if 0.0 then inclusion metric is omitted
    delta=1.0  # Weight for amplitude in fitness calculation # if 0.0 then amplitude metric is omitted
)

# Define the optimization task
task = Task(problem=niaarmts_problem, max_iters=100)  # Run for 100 iterations

# Initialize the Particle Swarm Optimization algorithm
pso = ParticleSwarmAlgorithm(population_size=40, min_velocity=-1.0, max_velocity=1.0, c1=2.0, c2=2.0)

# Run the algorithm
best_solution = pso.run(task)

# Output the best solution and its fitness value
print(f"Best solution: {best_solution[0]}")
print(f"Fitness value: {best_solution[1]}")
```

## πŸ“š Reference Papers

Ideas are based on the following research papers:

[1] Iztok Fister Jr., DuΕ‘an Fister, Iztok Fister, Vili Podgorelec, Sancho Salcedo-Sanz. [Time series numerical association rule mining variants in smart agriculture](https://iztok.link/static/publications/314.pdf). Journal of Ambient Intelligence and Humanized Computing (2023): 1-14.

[2] Iztok Fister Jr., Iztok Fister, Sancho Salcedo-Sanz. [Time Series Numerical Association Rule Mining for assisting Smart Agriculture](https://iztok.link/static/publications/298.pdf). In: International Conference on Electrical, Computer and Energy Technologies (ICECET). IEEE, 2022.

[3] I. Fister Jr., A. Iglesias, A. GΓ‘lvez, J. Del Ser, E. Osaba, I Fister. [Differential evolution for association rule mining using categorical and numerical attributes](http://www.iztok-jr-fister.eu/static/publications/231.pdf) In: Intelligent data engineering and automated learning - IDEAL 2018, pp. 79-88, 2018.

[4] I. Fister Jr., V. Podgorelec, I. Fister. [Improved Nature-Inspired Algorithms for Numeric Association Rule Mining](https://iztok-jr-fister.eu/static/publications/324.pdf). In: Vasant P., Zelinka I., Weber GW. (eds) Intelligent Computing and Optimization. ICO 2020. Advances in Intelligent Systems and Computing, vol 1324. Springer, Cham.

[5] I. Fister Jr., I. Fister [A brief overview of swarm intelligence-based algorithms for numerical association rule mining](https://arxiv.org/abs/2010.15524). arXiv preprint arXiv:2010.15524 (2020).

[6] Fister, I. et al. (2020). [Visualization of Numerical Association Rules by Hill Slopes](http://www.iztok-jr-fister.eu/static/publications/280.pdf).
    In: Analide, C., Novais, P., Camacho, D., Yin, H. (eds) Intelligent Data Engineering and Automated Learning – IDEAL 2020.
    IDEAL 2020. Lecture Notes in Computer Science(), vol 12489. Springer, Cham. https://doi.org/10.1007/978-3-030-62362-3_10

[7] I. Fister, S. Deb, I. Fister, [Population-based metaheuristics for Association Rule Text Mining](http://www.iztok-jr-fister.eu/static/publications/260.pdf),
    In: Proceedings of the 2020 4th International Conference on Intelligent Systems, Metaheuristics & Swarm Intelligence,
    New York, NY, USA, mar. 2020, pp. 19–23. doi: [10.1145/3396474.3396493](https://dl.acm.org/doi/10.1145/3396474.3396493).

[8] I. Fister, I. Fister Jr., D. Novak and D. Verber, [Data squashing as preprocessing in association rule mining](https://iztok-jr-fister.eu/static/publications/300.pdf), 2022 IEEE Symposium Series on Computational Intelligence (SSCI), Singapore, Singapore, 2022, pp. 1720-1725, doi: [10.1109/SSCI51031.2022.10022240](https://doi.org/10.1109/SSCI51031.2022.10022240).

## See also

[1] [NiaARM.jl: Numerical Association Rule Mining in Julia](https://github.com/firefly-cpp/NiaARM.jl)

[2] [arm-preprocessing: Implementation of several preprocessing techniques for Association Rule Mining (ARM)](https://github.com/firefly-cpp/arm-preprocessing)

## πŸ”‘ License

This package is distributed under the MIT License. This license can be found online at <http://www.opensource.org/licenses/MIT>.

## Disclaimer

This framework is provided as-is, and there are no guarantees that it fits your purposes or that it is bug-free. Use it at your own risk!

## πŸ“„ Cite us

[^1] Fister Jr, I., Yang, X. S., Fister, I., Brest, J., & Fister, D. (2013). [A brief review of nature-inspired algorithms for optimization](https://arxiv.org/abs/1307.4186). arXiv preprint arXiv:1307.4186.

[^2] Iztok Fister Jr., DuΕ‘an Fister, Iztok Fister, Vili Podgorelec, Sancho Salcedo-Sanz. [Time series numerical association rule mining variants in smart agriculture](https://iztok.link/static/publications/314.pdf). Journal of Ambient Intelligence and Humanized Computing (2023): 1-14.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "niaarmts",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.12",
    "maintainer_email": null,
    "keywords": null,
    "author": "Iztok Fister Jr.",
    "author_email": "iztok@iztok-jr-fister.eu",
    "download_url": "https://files.pythonhosted.org/packages/a1/a9/869b0d4fb8c55b4b978d6b73e47a306606c4c554d67f52595df62d6f9d0a/niaarmts-0.1.1.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\">\n    Nature-Inspired Algorithms for Time Series Numerical Association Rule Mining\n</h1>\n\n<p align=\"center\">\n    <a href=\"#-features\">\u2728 Features</a> \u2022\n    <a href=\"#-installation\">\ud83d\udce6 Installation</a> \u2022\n    <a href=\"#-basic-example\">\ud83d\ude80 Basic example</a> \u2022\n    <a href=\"#-reference-papers\">\ud83d\udcda Reference Papers</a> \u2022\n    <a href=\"#-license\">\ud83d\udd11 License</a> \u2022\n    <a href=\"#-cite-us\">\ud83d\udcc4 Cite us</a>\n</p>\n\nThis framework is designed for **numerical association rule mining in time series data** using **stochastic population-based nature-inspired algorithms**[^1]. It provides tools to extract association rules from time series datasets while incorporating key metrics such as **support**, **confidence**, **inclusion**, and **amplitude**. Although independent from the NiaARM framework, this software can be viewed as an extension, with additional support for time series numerical association rule mining.\n\n## \u2728 Features\n\nThe current version of the framework supports two types of time series numerical association rule mining:\n\n- **Fixed Interval Time Series Numerical Association Rule Mining**\n- **Segmented Interval Time Series Numerical Association Rule Mining**\n\n## \ud83d\udce6 Installation\n\nTo install `NiaARMTS` with pip, use:\n\n```sh\npip install niaarmts\n```\n\n## \ud83d\ude80 Basic example\n\n```python\nfrom niapy.algorithms.basic import ParticleSwarmAlgorithm\nfrom niapy.task import Task\nfrom niaarmts import Dataset\nfrom niaarmts.NiaARMTS import NiaARMTS\n\n# Load dataset\ndataset = Dataset()\ndataset.load_data_from_csv('ts.csv', timestamp_col='timestamp')\n\n# Create an instance of NiaARMTS\nniaarmts_problem = NiaARMTS(\n    dimension=dataset.calculate_problem_dimension(),  # Adjust dimension dynamically\n    lower=0.0,  # Lower bound of solution space\n    upper=1.0,  # Upper bound of solution space\n    features=dataset.get_all_features_with_metadata(),  # Pass feature metadata\n    transactions=dataset.get_all_transactions(),  # Dataframe containing all transactions\n    interval='false',  # Whether we're dealing with interval data\n    alpha=1.0,  # Weight for support in fitness calculation\n    beta=1.0,  # Weight for confidence in fitness calculation\n    gamma=1.0,  # Weight for inclusion in fitness calculation # if 0.0 then inclusion metric is omitted\n    delta=1.0  # Weight for amplitude in fitness calculation # if 0.0 then amplitude metric is omitted\n)\n\n# Define the optimization task\ntask = Task(problem=niaarmts_problem, max_iters=100)  # Run for 100 iterations\n\n# Initialize the Particle Swarm Optimization algorithm\npso = ParticleSwarmAlgorithm(population_size=40, min_velocity=-1.0, max_velocity=1.0, c1=2.0, c2=2.0)\n\n# Run the algorithm\nbest_solution = pso.run(task)\n\n# Output the best solution and its fitness value\nprint(f\"Best solution: {best_solution[0]}\")\nprint(f\"Fitness value: {best_solution[1]}\")\n```\n\n## \ud83d\udcda Reference Papers\n\nIdeas are based on the following research papers:\n\n[1] Iztok Fister Jr., Du\u0161an Fister, Iztok Fister, Vili Podgorelec, Sancho Salcedo-Sanz. [Time series numerical association rule mining variants in smart agriculture](https://iztok.link/static/publications/314.pdf). Journal of Ambient Intelligence and Humanized Computing (2023): 1-14.\n\n[2] Iztok Fister Jr., Iztok Fister, Sancho Salcedo-Sanz. [Time Series Numerical Association Rule Mining for assisting Smart Agriculture](https://iztok.link/static/publications/298.pdf). In: International Conference on Electrical, Computer and Energy Technologies (ICECET). IEEE, 2022.\n\n[3] I. Fister Jr., A. Iglesias, A. G\u00e1lvez, J. Del Ser, E. Osaba, I Fister. [Differential evolution for association rule mining using categorical and numerical attributes](http://www.iztok-jr-fister.eu/static/publications/231.pdf) In: Intelligent data engineering and automated learning - IDEAL 2018, pp. 79-88, 2018.\n\n[4] I. Fister Jr., V. Podgorelec, I. Fister. [Improved Nature-Inspired Algorithms for Numeric Association Rule Mining](https://iztok-jr-fister.eu/static/publications/324.pdf). In: Vasant P., Zelinka I., Weber GW. (eds) Intelligent Computing and Optimization. ICO 2020. Advances in Intelligent Systems and Computing, vol 1324. Springer, Cham.\n\n[5] I. Fister Jr., I. Fister [A brief overview of swarm intelligence-based algorithms for numerical association rule mining](https://arxiv.org/abs/2010.15524). arXiv preprint arXiv:2010.15524 (2020).\n\n[6] Fister, I. et al. (2020). [Visualization of Numerical Association Rules by Hill Slopes](http://www.iztok-jr-fister.eu/static/publications/280.pdf).\n    In: Analide, C., Novais, P., Camacho, D., Yin, H. (eds) Intelligent Data Engineering and Automated Learning \u2013 IDEAL 2020.\n    IDEAL 2020. Lecture Notes in Computer Science(), vol 12489. Springer, Cham. https://doi.org/10.1007/978-3-030-62362-3_10\n\n[7] I. Fister, S. Deb, I. Fister, [Population-based metaheuristics for Association Rule Text Mining](http://www.iztok-jr-fister.eu/static/publications/260.pdf),\n    In: Proceedings of the 2020 4th International Conference on Intelligent Systems, Metaheuristics & Swarm Intelligence,\n    New York, NY, USA, mar. 2020, pp. 19\u201323. doi: [10.1145/3396474.3396493](https://dl.acm.org/doi/10.1145/3396474.3396493).\n\n[8] I. Fister, I. Fister Jr., D. Novak and D. Verber, [Data squashing as preprocessing in association rule mining](https://iztok-jr-fister.eu/static/publications/300.pdf), 2022 IEEE Symposium Series on Computational Intelligence (SSCI), Singapore, Singapore, 2022, pp. 1720-1725, doi: [10.1109/SSCI51031.2022.10022240](https://doi.org/10.1109/SSCI51031.2022.10022240).\n\n## See also\n\n[1] [NiaARM.jl: Numerical Association Rule Mining in Julia](https://github.com/firefly-cpp/NiaARM.jl)\n\n[2] [arm-preprocessing: Implementation of several preprocessing techniques for Association Rule Mining (ARM)](https://github.com/firefly-cpp/arm-preprocessing)\n\n## \ud83d\udd11 License\n\nThis package is distributed under the MIT License. This license can be found online at <http://www.opensource.org/licenses/MIT>.\n\n## Disclaimer\n\nThis framework is provided as-is, and there are no guarantees that it fits your purposes or that it is bug-free. Use it at your own risk!\n\n## \ud83d\udcc4 Cite us\n\n[^1] Fister Jr, I., Yang, X. S., Fister, I., Brest, J., & Fister, D. (2013). [A brief review of nature-inspired algorithms for optimization](https://arxiv.org/abs/1307.4186). arXiv preprint arXiv:1307.4186.\n\n[^2] Iztok Fister Jr., Du\u0161an Fister, Iztok Fister, Vili Podgorelec, Sancho Salcedo-Sanz. [Time series numerical association rule mining variants in smart agriculture](https://iztok.link/static/publications/314.pdf). Journal of Ambient Intelligence and Humanized Computing (2023): 1-14.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Time series numerical association rule mining variants",
    "version": "0.1.1",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "052adca9a9f72672311abc67fdcbdfe894d49b13721667a62ca86aff6f6f58c0",
                "md5": "243834c789e843a51c6a3113c451e49d",
                "sha256": "efd25224cfc5788f7279723917d8640d32e1e26dfaa11f8cfc524cd2786c8e76"
            },
            "downloads": -1,
            "filename": "niaarmts-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "243834c789e843a51c6a3113c451e49d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.12",
            "size": 13757,
            "upload_time": "2024-10-24T13:00:38",
            "upload_time_iso_8601": "2024-10-24T13:00:38.212664Z",
            "url": "https://files.pythonhosted.org/packages/05/2a/dca9a9f72672311abc67fdcbdfe894d49b13721667a62ca86aff6f6f58c0/niaarmts-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a1a9869b0d4fb8c55b4b978d6b73e47a306606c4c554d67f52595df62d6f9d0a",
                "md5": "f02ba869b719b60810746101791def38",
                "sha256": "7ec20a25ae5cfa6909dae6ee882cf0b4ddf11a77ff7c21c0e3c9d96eaac969b4"
            },
            "downloads": -1,
            "filename": "niaarmts-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "f02ba869b719b60810746101791def38",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.12",
            "size": 13819,
            "upload_time": "2024-10-24T13:00:39",
            "upload_time_iso_8601": "2024-10-24T13:00:39.859161Z",
            "url": "https://files.pythonhosted.org/packages/a1/a9/869b0d4fb8c55b4b978d6b73e47a306606c4c554d67f52595df62d6f9d0a/niaarmts-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-24 13:00:39",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "niaarmts"
}
        
Elapsed time: 0.59926s