{"id":14069036,"url":"https://github.com/mhahsler/arules","last_synced_at":"2026-01-16T07:58:37.484Z","repository":{"id":45935755,"uuid":"44082378","full_name":"mhahsler/arules","owner":"mhahsler","description":"Mining Association Rules and Frequent Itemsets with R","archived":false,"fork":false,"pushed_at":"2025-05-01T20:26:42.000Z","size":30425,"stargazers_count":195,"open_issues_count":2,"forks_count":44,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-01T21:41:44.835Z","etag":null,"topics":["arules","association-rules","cran","frequent-itemsets","r"],"latest_commit_sha":null,"homepage":"http://mhahsler.github.io/arules","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mhahsler.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-10-12T03:35:42.000Z","updated_at":"2025-05-01T20:26:46.000Z","dependencies_parsed_at":"2023-10-10T17:27:55.525Z","dependency_job_id":"ff445b83-95b4-428c-a7ad-e0c230ccca2f","html_url":"https://github.com/mhahsler/arules","commit_stats":{"total_commits":439,"total_committers":6,"mean_commits":73.16666666666667,"dds":0.06605922551252852,"last_synced_commit":"dc958e5ad253422dc6295f48cf21461e54564a90"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhahsler%2Farules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhahsler%2Farules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhahsler%2Farules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhahsler%2Farules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhahsler","download_url":"https://codeload.github.com/mhahsler/arules/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254328386,"owners_count":22052632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arules","association-rules","cran","frequent-itemsets","r"],"created_at":"2024-08-13T07:06:33.657Z","updated_at":"2026-01-16T07:58:37.477Z","avatar_url":"https://github.com/mhahsler.png","language":"R","funding_links":[],"categories":["R","Table of Contents"],"sub_categories":["Machine learning"],"readme":"---\noutput: github_document\n---\n\n```{r echo=FALSE, results = 'asis'}\npkg \u003c- \"arules\"\n\nsource(\"https://raw.githubusercontent.com/mhahsler/pkg_helpers/main/pkg_helpers.R\")\npkg_title(pkg, anaconda = \"r-arules\", stackoverflow = \"arules\")\n```\n\n## Introduction\n\nThe arules package family for R provides the infrastructure for representing,\nmanipulating and analyzing transaction data and patterns\nusing [frequent itemsets and association rules](https://en.wikipedia.org/wiki/Association_rule_learning).\nThe package also provides a wide range of \n[interest measures](https://mhahsler.github.io/arules/docs/measures) and mining algorithms including the code of\nChristian Borgelt's popular and efficient C implementations of the association mining algorithms [Apriori](https://borgelt.net/apriori.html) and [Eclat](https://borgelt.net/eclat.html). In addition, the following mining algorithms are\navailable via [fim4r](https://borgelt.net/fim4r.html):\n\n* Apriori\n* Eclat\n* Carpenter\n* FPgrowth\n* IsTa \n* RElim \n* SaM\n\nCode examples can be found in\n[Chapter 5 of the web book R Companion for Introduction to Data\nMining](https://mhahsler.github.io/Introduction_to_Data_Mining_R_Examples/book/association-analysis-basic-concepts.html).\n\n```{r echo=FALSE, results = 'asis'}\npkg_citation(pkg, 2)\n```\n\n## Packages\n\n### arules core packages\n\n* [arules](https://cran.r-project.org/package=arules): arules base package with data structures, mining algorithms (APRIORI and ECLAT), interest measures. \n* [arulesViz](https://github.com/mhahsler/arulesViz): Visualization of association rules. \n* [arulesCBA](https://github.com/mhahsler/arulesCBA): Classification algorithms based on association rules (includes CBA).  \n* [arulesSequences](https://cran.r-project.org/package=arulesSequences): Mining frequent sequences (cSPADE).\n\n### Other related packages\n\nAdditional mining algorithms \n\n* [arulesNBMiner](https://github.com/mhahsler/arulesNBMiner): Mining NB-frequent itemsets and NB-precise rules.\n* [fim4r](https://borgelt.net/fim4r.html): Provides fast implementations for several mining algorithms. An interface function called `fim4r()` is provided in `arules`.\n* [opusminer](https://cran.r-project.org/package=opusminer): OPUS Miner algorithm for finding the op k productive, non-redundant itemsets. Call `opus()` with `format = 'itemsets'`. \n* [RKEEL](https://cran.r-project.org/package=RKEEL): Interface to KEEL's association rule mining algorithm.\n* [RSarules](https://cran.r-project.org/package=RSarules): Mining algorithm which randomly samples association rules with one pre-chosen item as the consequent from a transaction dataset.\n\n\nIn-database analytics\n\n* [ibmdbR](https://cran.r-project.org/package=ibmdbR): IBM in-database analytics for R can calculate association rules from a database table.\n* [rfml](https://cran.r-project.org/package=rfml): Mine frequent itemsets or association rules using a MarkLogic server. \n\nInterface\n\n* [rattle](https://cran.r-project.org/package=rattle): Provides a graphical user interface for association rule mining.\n* [pmml](https://cran.r-project.org/package=pmml): Generates PMML (predictive model markup language) for association rules.\n\nClassification \n\n* [arc](https://cran.r-project.org/package=arc): Alternative CBA implementation. \n* [inTrees](https://cran.r-project.org/package=inTrees): Interpret Tree Ensembles provides functions for: extracting, measuring and pruning rules; selecting a compact rule set; summarizing rules into a learner.\n* [rCBA](https://cran.r-project.org/package=rCBA): Alternative CBA implementation.\n* [qCBA](https://cran.r-project.org/package=qCBA): Quantitative Classification by Association Rules.\n* [sblr](https://cran.r-project.org/package=sbrl): Scalable Bayesian rule lists algorithm for classification.\n\nOutlier Detection\n\n* [fpmoutliers](https://cran.r-project.org/package=fpmoutliers): Frequent Pattern Mining Outliers.\n\nRecommendation/Prediction\n\n* [recommenerlab](https://github.com/mhahsler/recommenderlab): Supports creating predictions using association rules.\n\n\n```{r echo=FALSE, results = 'asis'}\npkg_usage(pkg)\n```\n\n```{r echo=FALSE, results = 'asis'}\npkg_install(pkg)\n```\n\n## Usage\n\nLoad package and mine some association rules. \n```{r }\nlibrary(\"arules\")\ndata(\"IncomeESL\")\n\ntrans \u003c- transactions(IncomeESL)\ntrans\n\nrules \u003c- apriori(trans, supp = 0.1, conf = 0.9, target = \"rules\")\n```\n\nInspect the rules with the highest lift.\n```{r }\ninspect(head(rules, n = 3, by = \"lift\"))\n```\n\n## Using arules with tidyverse\n\n`arules` works seamlessly with [tidyverse](https://tidyverse.org/). For example: \n\n* `dplyr` can be used for cleaning and preparing the transactions.\n* `transaction()` and other functions accept `tibble` as input.\n* Functions in arules can be connected with the pipe operator `|\u003e`.\n* [arulesViz](https://github.com/mhahsler/arulesViz) provides visualizations based on `ggplot2`.\n\nFor example, we can remove the ethnic information column before creating transactions and then mine and inspect rules.\n```{r }\nlibrary(\"tidyverse\")\nlibrary(\"arules\")\ndata(\"IncomeESL\")\n\ntrans \u003c- IncomeESL |\u003e\n  select(-`ethnic classification`) |\u003e\n  transactions()\nrules \u003c- trans |\u003e\n  apriori(\n    supp = 0.1, conf = 0.9, target = \"rules\",\n    control = list(verbose = FALSE)\n  )\nrules |\u003e\n  head(3, by = \"lift\") |\u003e\n  as(\"data.frame\") |\u003e\n  tibble()\n```\n\n## Using arules from Python\n\n`arules` and `arulesViz` can now be used directly from Python with the Python \npackage [`arulespy`](https://pypi.org/project/arulespy/) available form PyPI. \n\n## Support\n\nPlease report bugs [here on GitHub.](https://github.com/mhahsler/arules/issues)\nQuestions should be posted on [stackoverflow and tagged with arules](https://stackoverflow.com/questions/tagged/arules).\n\n\n## References\n\n* Michael Hahsler. [ARULESPY: Exploring association rules and frequent itemsets in \n  Python.](http://dx.doi.org/10.48550/arXiv.2305.15263) arXiv:2305.15263 [cs.DB], May 2023.\n* Michael Hahsler. [An R Companion for Introduction to Data Mining: Chapter 5](https://mhahsler.github.io/Introduction_to_Data_Mining_R_Examples/book/association-analysis-basic-concepts.html), 2021, URL: https://mhahsler.github.io/Introduction_to_Data_Mining_R_Examples/book/\n* Hahsler, Michael. [A Probabilistic Comparison of Commonly Used Interest Measures for Association Rules](https://mhahsler.github.io/arules/docs/measures), 2015, URL: https://mhahsler.github.io/arules/docs/measures.\n* Michael Hahsler, Sudheer Chelluboina, Kurt Hornik, and Christian Buchta. [The arules R-package ecosystem: Analyzing interesting patterns from large transaction datasets.](https://jmlr.csail.mit.edu/papers/v12/hahsler11a.html) _Journal of Machine Learning Research,_ 12:1977-1981, 2011.\n* Michael Hahsler, Bettina Gr\u0026uuml;n and Kurt Hornik. [arules - A Computational Environment for Mining Association Rules and Frequent Item Sets.](https://dx.doi.org/10.18637/jss.v014.i15) _Journal of Statistical Software,_ 14(15), 2005.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhahsler%2Farules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhahsler%2Farules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhahsler%2Farules/lists"}