Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 13 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org, acm.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.9%) to scientific vocabulary
Last synced: 4 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: firefly-cpp
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 1.57 MB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • Open Issues: 0
  • Releases: 9
Created 12 months ago · Last pushed 4 months ago
Metadata Files
Readme License Code of conduct Citation

README.md

logo

Nature-Inspired Algorithms for Time Series Numerical Association Rule Mining

PyPI version PyPI - Python Version PyPI - Downloads Downloads NiaARMTS Documentation status

Repository size License GitHub commit activity Percentage of issues still open Average time to resolve an issue GitHub contributors

✨ Features📦 Installation🚀 Basic example📚 Reference Papers🔑 License📄 Cite us

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.

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

✨ 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

Fixed Interval Time Series Numerical Association Rule Mining 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.loaddatafromcsv('intervals.csv', timestampcol='timestamp')

Create an instance of NiaARMTS

niaarmtsproblem = NiaARMTS( dimension=dataset.calculateproblemdimension(), # Adjust dimension dynamically lower=0.0, # Lower bound of solution space upper=1.0, # Upper bound of solution space features=dataset.getallfeatureswithmetadata(), # Pass feature metadata transactions=dataset.getall_transactions(), # Dataframe containing all transactions interval='true', # 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=niaarmtsproblem, maxiters=100) # Run for 100 iterations

Initialize the Particle Swarm Optimization algorithm

pso = ParticleSwarmAlgorithm(populationsize=40, minvelocity=-1.0, max_velocity=1.0, c1=2.0, c2=2.0)

Run the algorithm

best_solution = pso.run(task)

Save discovered rules to CSV

niaarmtsproblem.saverulestocsv("interval_rules.csv")

Print all rules to the terminal

print("\n=== All Identified Rules (Interval Data, Sorted by Fitness) ===") for idx, rule in enumerate(niaarmtsproblem.getrule_archive(), 1): print(f"\nRule #{idx}:") print(f" Antecedent: {rule['antecedent']}") print(f" Consequent: {rule['consequent']}") print(f" Support: {rule['support']:.4f}") print(f" Confidence: {rule['confidence']:.4f}") print(f" Inclusion: {rule['inclusion']:.4f}") print(f" Amplitude: {rule['amplitude']:.4f}") print(f" Fitness: {rule['fitness']:.4f}") print(f" Interval: {rule['start']} (start) to {rule['end']} (end)") ```

Segmented Interval Time Series Numerical Association Rule Mining 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.loaddatafromcsv('ts.csv', timestampcol='timestamp')

Create an instance of NiaARMTS

niaarmtsproblem = NiaARMTS( dimension=dataset.calculateproblemdimension(), # Adjust dimension dynamically lower=0.0, # Lower bound of solution space upper=1.0, # Upper bound of solution space features=dataset.getallfeatureswithmetadata(), # Pass feature metadata transactions=dataset.getall_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=niaarmtsproblem, maxiters=100) # Run for 100 iterations

Initialize the Particle Swarm Optimization algorithm

pso = ParticleSwarmAlgorithm(populationsize=40, minvelocity=-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: {bestsolution[0]}") print(f"Fitness value: {bestsolution[1]}")

Save all discovered rules to a CSV file

niaarmtsproblem.saverulestocsv("discovered_rules.csv")

Print all rules to the terminal

print("\n=== All Identified Rules (Sorted by Fitness) ===") for idx, rule in enumerate(niaarmtsproblem.getrule_archive(), 1): print(f"\nRule #{idx}:") print(f" Antecedent: {rule['antecedent']}") print(f" Consequent: {rule['consequent']}") print(f" Support: {rule['support']:.4f}") print(f" Confidence: {rule['confidence']:.4f}") print(f" Inclusion: {rule['inclusion']:.4f}") print(f" Amplitude: {rule['amplitude']:.4f}") print(f" Fitness: {rule['fitness']:.4f}") print(f" Time window: {rule['start']} to {rule['end']}") ```

📚 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. 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. 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 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. 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. arXiv preprint arXiv:2010.15524 (2020).

[6] Fister, I. et al. (2020). Visualization of Numerical Association Rules by Hill Slopes. 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, 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.

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

See also

[1] NiaARM.jl: Numerical Association Rule Mining in Julia

[2] arm-preprocessing: Implementation of several preprocessing techniques for Association Rule Mining (ARM)

🔑 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, I., Jr.; Salcedo-Sanz, S.; Alexandre-Cortizo, E.; Novak, D.; Fister, I.; Podgorelec, V.; Gorenjak, M. Toward Explainable Time-Series Numerical Association Rule Mining: A Case Study in Smart-Agriculture. Mathematics 2025, 13, 2122. https://doi.org/10.3390/math13132122

[2] Iztok Fister Jr., Dušan Fister, Iztok Fister, Vili Podgorelec, Sancho Salcedo-Sanz. Time series numerical association rule mining variants in smart agriculture. Journal of Ambient Intelligence and Humanized Computing (2023): 1-14.

Owner

  • Name: Iztok Fister Jr.
  • Login: firefly-cpp
  • Kind: user
  • Location: Slovenia

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this repository, please cite the following publication:"
title: "Toward Explainable Time-Series Numerical Association Rule Mining: A Case Study in Smart-Agriculture"
authors:
  - family-names: Fister
    given-names: Iztok Jr.
  - family-names: Salcedo-Sanz
    given-names: Sancho
  - family-names: Alexandre-Cortizo
    given-names: Enrique
  - family-names: Novak
    given-names: Damijan
  - family-names: Fister
    given-names: Iztok
  - family-names: Podgorelec
    given-names: Vili
  - family-names: Gorenjak
    given-names: Mario
date-released: 2025-01-01
version: "1.0.0"
doi: "10.3390/math13132122"
url: "https://doi.org/10.3390/math13132122"
type: software

GitHub Events

Total
  • Release event: 7
  • Delete event: 2
  • Issue comment event: 2
  • Push event: 43
  • Pull request event: 18
  • Fork event: 6
  • Create event: 13
Last Year
  • Release event: 7
  • Delete event: 2
  • Issue comment event: 2
  • Push event: 43
  • Pull request event: 18
  • Fork event: 6
  • Create event: 13

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 0
  • Total pull requests: 20
  • Average time to close issues: N/A
  • Average time to close pull requests: 3 days
  • Total issue authors: 0
  • Total pull request authors: 3
  • Average comments per issue: 0
  • Average comments per pull request: 0.1
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 8
Past Year
  • Issues: 0
  • Pull requests: 20
  • Average time to close issues: N/A
  • Average time to close pull requests: 3 days
  • Issue authors: 0
  • Pull request authors: 3
  • Average comments per issue: 0
  • Average comments per pull request: 0.1
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 8
Top Authors
Issue Authors
Pull Request Authors
  • lahovniktadej (11)
  • dependabot[bot] (8)
  • rhododendrom (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (8) python (8)

Packages

  • Total packages: 6
  • Total downloads:
    • pypi 47 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 31
  • Total maintainers: 2
alpine-edge: py3-niaarmts-doc

Time series numerical association rule mining variants (documentation)

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Average: 6.6%
Dependent packages count: 13.2%
Maintainers (1)
Last synced: 4 months ago
alpine-edge: py3-niaarmts

Time series numerical association rule mining variants

  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Average: 7.1%
Dependent packages count: 14.2%
Maintainers (1)
Last synced: 4 months ago
alpine-edge: py3-niaarmts-pyc

Precompiled Python bytecode for py3-niaarmts

  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Average: 7.1%
Dependent packages count: 14.2%
Maintainers (1)
Last synced: 4 months ago
pypi.org: niaarmts

Time series numerical association rule mining variants

  • Versions: 11
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 47 Last month
Rankings
Dependent packages count: 10.2%
Average: 33.8%
Dependent repos count: 57.3%
Maintainers (1)
Last synced: 4 months ago
alpine-v3.22: py3-niaarmts-pyc

Precompiled Python bytecode for py3-niaarmts

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 4 months ago
alpine-v3.22: py3-niaarmts

Time series numerical association rule mining variants

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 4 months ago

Dependencies

.github/workflows/test.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
poetry.lock pypi
  • colorama 0.4.6
  • contourpy 1.3.1
  • cycler 0.12.1
  • et-xmlfile 2.0.0
  • fonttools 4.55.3
  • iniconfig 2.0.0
  • kiwisolver 1.4.8
  • matplotlib 3.10.0
  • niapy 2.5.2
  • numpy 1.26.4
  • openpyxl 3.1.5
  • packaging 24.2
  • pandas 2.2.3
  • pillow 11.1.0
  • pluggy 1.5.0
  • pyparsing 3.2.1
  • pytest 7.4.4
  • python-dateutil 2.9.0.post0
  • pytz 2024.2
  • six 1.17.0
  • tzdata 2024.2
pyproject.toml pypi
  • pytest ^7.0 develop
  • niapy ^2.5.2
  • pandas ^2.2.3
  • python >=3.11,<3.14
requirements.txt pypi
  • niapy *
  • pandas *
docs/requirements.txt pypi
  • niapy >=2.5.2,<3.0.0
  • pandas >=2.2.3,<3.0.0
  • sphinx *
  • sphinx-rtd-theme *