π About β’ β¨ Detailed insights β’ π¦ Installation β’ π Usage β’ π Reference papers β’ π License
niarules is an R framework designed for mining numerical association rules through the utilization of nature-inspired algorithms for optimization. Drawing inspiration from both the NiaARM Python package and NiaARM.jl package, this repository introduces the capability to perform numerical association rule mining in the R programming language.
The current version of niarules included in this framework offers seamless functionality for automatic dataset loading and preprocessing. It facilitates the exploration of numerical association rules through the application of nature-inspired algorithms, ultimately presenting a comprehensive output that includes identified association rules. Aligning with the principles of the original NiaARM implementation, the process of numerical association rule mining is conceptualized as an optimization problem, and the solution is achieved using population-based nature-inspired algorithms integrated within this framework. Besides the conventional numerical association rule mining, the current version also adds support for Segmented Interval Time Series Numerical Association Rule Mining as proposed in NiaARMTS.
The current version includes (but is not limited to) the following functions:
Install CRAN release version:
install.packages("niarules")
library("niarules")
# Define the dataset file
<- "Abalone.csv"
dataset
# Read dataset
<- read_dataset(dataset)
data
# Extract feature information
<- extract_feature_info(data)
features
# Determine problem dimension
<- problem_dimension(features, is_time_series = FALSE)
dim
# Run Differential Evolution Algorithm
<- differential_evolution(
de d = dim,
np = 30,
f = 0.5,
cr = 0.9,
nfes = 1000,
features = features,
data = data,
is_time_series = FALSE
)
# Print identified association rules
print_association_rules(de$arules, is_time_series = FALSE)
# Save association rules to a CSV file
write_association_rules_to_csv(de$arules, "Rules.csv", is_time_series = FALSE)
library("niarules")
# Define the dataset file (Ensure you have a time series dataset in CSV format)
<- "ts2.csv"
dataset
# Read dataset
<- read_dataset(dataset, timestamp_col = "timestamp")
data
# Extract feature information
<- extract_feature_info(data)
features
# Determine problem dimension
<- problem_dimension(features, is_time_series = TRUE)
dim
# Run Differential Evolution Algorithm for time series data
<- differential_evolution(
de d = dim,
np = 30,
f = 0.5,
cr = 0.9,
nfes = 1000,
features = features,
data = data,
is_time_series = TRUE
)
# Print identified association rules
print_association_rules(de$arules, is_time_series = TRUE, timestamps = data[["timestamp"]])
# Save association rules to a CSV file
write_association_rules_to_csv(de$arules, "Rules.csv", is_time_series = TRUE, timestamps = data[["timestamp"]])
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.
[9] Stupan, Ε½., & Fister Jr., I. (2022). NiaARM: A minimalistic framework for Numerical Association Rule Mining. Journal of Open Source Software, 7(77), 4448.
[1] NiaARM.jl: Numerical Association Rule Mining in Julia
[2] NiaARM: Numerical Association Rule Mining in Python
[4] NiaARMTS: Nature-Inspired Algorithms for Time Series Numerical Association Rule Mining
This package is distributed under the MIT License. This license can be found online at http://www.opensource.org/licenses/MIT.
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!