AutoARM
AutoARM simplifies and automates association rule mining and related tasks. With just a few lines of code, you can format data and make recommendations based on the results of association rule mining.
If you use a rule-based recommender system, you are able to explain the rationale for the recommendation. For example, a recommendation such as "You should buy B, because 90% of those who bought A that you are already considering buying also buy B.". Then, the people who received the explanation are satisfied with the recommendation. As a result, it will encourage their actions.
Overview of Recommender
- Split rules consequents
- Identify rules that match the items entered
- Exclude rules that have entered items in consequents (This procces can be skipped)
- Sort rules by confidence or lift specified as a metric
- Exclude duplicate consequents and leave higher rules
- Output rules of the specified size
Example
Recommender that use association rules are generated as follows.
import pandas as pd
from autoarm import AssociationRules, Dataset, FrequentItemsets, Recommender
sample_dataset = {
'transaction_id':
[1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7],
'item_id': [
"X", "Y", "Z", "X", "B", "Y", "A", "C", "A", "C", "X", "Y", "Z",
"X", "Y", "B", "A", "X", "B"
],
}
df = pd.DataFrame.from_dict(sample_dataset)
dataset = Dataset(df, "transaction_id", "item_id")
frequent_itemsets = FrequentItemsets(dataset, min_support=0.01)
association_rules = AssociationRules(frequent_itemsets,
metric="confidence",
min_threshold=0.1)
recommender = Recommender(association_rules)
Recommender, which is provided with the necessary information such as items, outputs useful rules for recommendation.
items = ["X", "Y"]
recommend_rules = recommender.recommend(items, n=3, metric="confidence")
recommend_rules
| rank | antecedents | consequents | support | confidence | lift |
|---|---|---|---|---|---|
| 1 | (X, Y) | (Z) | 0.285714 | 0.666667 | 2.333333 |
| 2 | (X) | (B) | 0.428571 | 0.600000 | 1.400000 |
| 3 | (Y) | (A) | 0.285714 | 0.500000 | 1.166667 |
For example, based on this output, recommendations can be made using the following description. "You should buy Z, because 66% of those who bought X and Y that you are already considering buying also buy Z.".
Metadata
Release files for autoarm 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| autoarm-0.1.0.tar.gz | 10.4 kB | Without provenance | Details for autoarm-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| autoarm-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for autoarm-0.1.0-py3-none-any.whl |
Total release size: 23.9 kB
Release files / autoarm-0.1.0.tar.gz
| Download URL | autoarm-0.1.0.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
118d716d12bc569b401ebb3f7555fc210382312a3960903dcd2e05971e5f0be6
|
|
BLAKE2b-256 checksum How to use checksums |
d6c11796c871cd2d650d1dcbeaa6aa0d77a50eb2830addb4ef129082f92c5710
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10
|
Release files / autoarm-0.1.0-py3-none-any.whl
| Download URL | autoarm-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4dacbc8bca5630229d3b83f6c9e49417331a3ff346b40a914bb8b89686536260
|
|
BLAKE2b-256 checksum How to use checksums |
abc6025dafcd1bf54ed2833de323f1610496b525cb133a8c8327335457aaf5ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10
|
Security for autoarm 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.