from pycaret.datasets import get_data
get_data('index')
Dataset | Data Types | Default Task | Target Variable | # Instances | # Attributes | Missing Values | |
---|---|---|---|---|---|---|---|
0 | cancer | Multivariate | Classification | Class | 683 | 10 | N |
1 | credit | Multivariate | Classification | default | 24000 | 24 | N |
2 | employee | Multivariate | Classification | left | 14999 | 10 | N |
3 | heart | Multivariate | Classification | DEATH | 200 | 17 | N |
4 | hepatitis | Multivariate | Classification | Class | 154 | 32 | Y |
5 | income | Multivariate | Classification | income >50K | 32561 | 14 | Y |
6 | iris | Multivariate | Classification | Class | 100 | 5 | N |
7 | juice | Multivariate | Classification | Purchase | 1070 | 15 | N |
8 | heart_disease | Multivariate | Classification | Disease | 270 | 14 | N |
9 | glass | Multivariate | Multiclass Classification | Type | 214 | 10 | N |
10 | satellite | Multivariate | Multiclass Classification | Class | 6435 | 37 | N |
11 | poker | Multivariate | Multiclass Classification | CLASS | 100000 | 11 | N |
12 | automobile | Multivariate | Regression | price | 202 | 26 | Y |
13 | bike | Multivariate | Regression | cnt | 17379 | 15 | N |
14 | boston | Multivariate | Regression | medv | 506 | 14 | N |
15 | diamond | Multivariate | Regression | Price | 6000 | 8 | N |
16 | gold | Multivariate | Regression | Gold_T+22 | 2558 | 121 | N |
17 | tweets | Text | NLP | tweet | 8594 | 2 | N |
18 | amazon | Text | NLP / Classification | reviewText | 20000 | 2 | N |
19 | kiva | Text | NLP / Classification | en | 6818 | 7 | N |
20 | spx | Text | NLP / Regression | text | 874 | 4 | N |
21 | germany | Multivariate | Association Rule Mining | InvoiceNo, Description | 9495 | 8 | N |
22 | france | Multivariate | Association Rule Mining | InvoiceNo, Description | 8557 | 8 | N |
data = get_data('france')
InvoiceNo | StockCode | Description | Quantity | InvoiceDate | UnitPrice | CustomerID | Country | |
---|---|---|---|---|---|---|---|---|
0 | 536370 | 22728 | ALARM CLOCK BAKELIKE PINK | 24 | 12/1/2010 8:45 | 3.75 | 12583.0 | France |
1 | 536370 | 22727 | ALARM CLOCK BAKELIKE RED | 24 | 12/1/2010 8:45 | 3.75 | 12583.0 | France |
2 | 536370 | 22726 | ALARM CLOCK BAKELIKE GREEN | 12 | 12/1/2010 8:45 | 3.75 | 12583.0 | France |
3 | 536370 | 21724 | PANDA AND BUNNIES STICKER SHEET | 12 | 12/1/2010 8:45 | 0.85 | 12583.0 | France |
4 | 536370 | 21883 | STARS GIFT TAPE | 24 | 12/1/2010 8:45 | 0.65 | 12583.0 | France |
from pycaret.arules import *
s = setup(data, 'InvoiceNo', item_id='Description')
Description | Value |
---|---|
session_id | 1262 |
# Transactions | 461 |
# Items | 1565 |
Ignore Items | None |
a1 = create_model()
a1
antecedents | consequents | antecedent support | consequent support | support | confidence | lift | leverage | conviction | |
---|---|---|---|---|---|---|---|---|---|
0 | (JUMBO BAG WOODLAND ANIMALS) | (POSTAGE) | 0.0651 | 0.6746 | 0.0651 | 1.0000 | 1.4823 | 0.0212 | inf |
1 | (SET/6 RED SPOTTY PAPER PLATES, SET/20 RED RET... | (SET/6 RED SPOTTY PAPER CUPS) | 0.0868 | 0.1171 | 0.0846 | 0.9750 | 8.3236 | 0.0744 | 35.3145 |
2 | (SET/6 RED SPOTTY PAPER CUPS, SET/20 RED RETRO... | (SET/6 RED SPOTTY PAPER PLATES) | 0.0868 | 0.1085 | 0.0846 | 0.9750 | 8.9895 | 0.0752 | 35.6616 |
3 | (SET/6 RED SPOTTY PAPER PLATES, POSTAGE, SET/2... | (SET/6 RED SPOTTY PAPER CUPS) | 0.0716 | 0.1171 | 0.0694 | 0.9697 | 8.2783 | 0.0610 | 29.1345 |
4 | (POSTAGE, SET/6 RED SPOTTY PAPER CUPS, SET/20 ... | (SET/6 RED SPOTTY PAPER PLATES) | 0.0716 | 0.1085 | 0.0694 | 0.9697 | 8.9406 | 0.0617 | 29.4208 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
136 | (STRAWBERRY LUNCH BOX WITH CUTLERY) | (LUNCH BOX WITH CUTLERY RETROSPOT ) | 0.1041 | 0.1236 | 0.0542 | 0.5208 | 4.2124 | 0.0414 | 1.8289 |
137 | (LUNCH BAG APPLE DESIGN) | (LUNCH BAG SPACEBOY DESIGN ) | 0.1085 | 0.1041 | 0.0564 | 0.5200 | 4.9942 | 0.0451 | 1.8664 |
138 | (LUNCH BAG APPLE DESIGN) | (LUNCH BAG RED RETROSPOT) | 0.1085 | 0.1323 | 0.0564 | 0.5200 | 3.9298 | 0.0420 | 1.8077 |
139 | (PLASTERS IN TIN CIRCUS PARADE , POSTAGE) | (PLASTERS IN TIN SPACEBOY) | 0.1258 | 0.1193 | 0.0629 | 0.5000 | 4.1909 | 0.0479 | 1.7614 |
140 | (LUNCH BAG RED RETROSPOT, POSTAGE) | (LUNCH BAG APPLE DESIGN) | 0.1041 | 0.1085 | 0.0521 | 0.5000 | 4.6100 | 0.0408 | 1.7831 |
141 rows × 9 columns
plot_model(a1)
plot_model(a1, plot='3d')