{"id":28313583,"url":"https://github.com/nullhawk/apriori-algorithm","last_synced_at":"2025-06-23T17:31:46.095Z","repository":{"id":292325918,"uuid":"980500734","full_name":"nullHawk/apriori-algorithm","owner":"nullHawk","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-09T09:50:15.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-01T06:14:26.646Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nullHawk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-05-09T08:27:42.000Z","updated_at":"2025-05-09T09:50:18.000Z","dependencies_parsed_at":"2025-05-09T18:30:59.736Z","dependency_job_id":null,"html_url":"https://github.com/nullHawk/apriori-algorithm","commit_stats":null,"previous_names":["nullhawk/apriori-algorithm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nullHawk/apriori-algorithm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullHawk%2Fapriori-algorithm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullHawk%2Fapriori-algorithm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullHawk%2Fapriori-algorithm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullHawk%2Fapriori-algorithm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nullHawk","download_url":"https://codeload.github.com/nullHawk/apriori-algorithm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullHawk%2Fapriori-algorithm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261522541,"owners_count":23171838,"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":[],"created_at":"2025-05-24T18:11:07.974Z","updated_at":"2025-06-23T17:31:46.061Z","avatar_url":"https://github.com/nullHawk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Apriori Algorithm\n\nA minimal Python implementation of the **Apriori algorithm** for frequent itemset mining and association rule learning. This project demonstrates how to implement the Apriori algorithm from scratch.\n\n---\n\n## Features\n\n* **Frequent Itemset Mining**: Find frequent itemsets from a list of transactions.\n* **Association Rule Generation**: Generate association rules with confidence and support.\n\n---\n\n## Installation\n\nYou can install the package directly from your local repository or from GitHub:\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/nullHawk/apriori-algorithm\ncd apriori-algorithm\n```\n\n### 2. Install in Editable Mode (for Development)\n\nThis allows you to make changes and have them reflected immediately.\n\n```bash\npip install -e .\n```\n\n---\n\n## Usage\n\n### Example Usage\n\n```python\nfrom apriori_algorithm.main import apriori, generate_rules\n\n# Example transactions (each transaction is a list of items)\ntransactions = [\n    ['milk', 'bread', 'nuts', 'apple'],\n    ['milk', 'bread', 'nuts'],\n    ['milk', 'bread'],\n    ['milk', 'apple'],\n    ['bread', 'apple']\n]\n\n# Set the minimum support and confidence values\nmin_support = 0.6\nmin_confidence = 0.7\n\n# Find frequent itemsets\nfrequent_itemsets = apriori(transactions, min_support)\n\n# Generate association rules\nrules = generate_rules(frequent_itemsets, min_confidence)\n\nprint(\"Frequent Itemsets:\", frequent_itemsets)\nprint(\"Association Rules:\", rules)\n```\n\n### Example Output\n\n```python\nFrequent Itemsets: {\n    frozenset({'milk'}): 0.8,\n    frozenset({'bread'}): 0.8,\n    frozenset({'apple'}): 0.6,\n    frozenset({'milk', 'bread'}): 0.6\n}\n\nAssociation Rules: [\n    (frozenset({'bread'}), frozenset({'milk'}), 0.6, 0.75),\n    (frozenset({'milk'}), frozenset({'bread'}), 0.6, 0.75)\n]\n```\n\n---\n\n## Tests\n\nTo run the tests, ensure you have `unittest` available:\n\n### Run Tests\n\n```bash\nPYTHONPATH=src python -m unittest discover -s tests\n```\n\nThis will discover and run all the test cases in the `tests/` directory.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullhawk%2Fapriori-algorithm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnullhawk%2Fapriori-algorithm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullhawk%2Fapriori-algorithm/lists"}