• Home
  • Swinburne University of Technology
  • Data Mining
  • Association/Market Basket Analysis using Rattle in Data Mining

Association/Market Basket Analysis using Rattle in Data Mining

STA30004: Data Mining Tutorial for Week 4 Association/Market Basket Analysis using Rattle: See Chapter 10 in Williams (2011) Now instructions for loading rattle. This has to be done in the computer lab and at home after entering RStudio. It does not work for me if I do not have RStudio open. Choose the appropriate platform. In the lab we are using Windows. Use the Melbourne(1) CRAN mirror when prompted. You may be prompted to load additional packages. Any OS > install. packages ("https://togaware.com/access/rattle 5.0.14.tar.gz", repos=NULL, type="source") Linux > install. packages ("rattle") > install. packages ( "https: //cran.r- project. org/src/contrib/Archive/RGtk2/RGtk2 2.20.31. tar.gz", repos=NULL) Windows > install. packages ("rattle") > install. packages ("https: // cran.r- project. org/bin/windows/contrib/3.3/RGtk2 2.20.31.zip", repos=NULL) a) Download all the csv files from Blackboard and save them in a suitable folder (e.g. H:\R in the computer lab). We will use the assocs.csv dataset to start. Set the roles of the variables as indicated below. Then Execute and View the file. What did the fifth customer buy? Data Explore Test Transform Cluster Associate Model Evaluate Log Source: Spreadsheet ARFF ODBC R Dataset Filename: assocs.csv Separator: Decimal: Partition 70/15/15 Seed: 42 View RData File Library Header Edit Input Ignore Weight Calculator: Corpus Script Target Data Type Auto Categoric Numeric No. Variable Data Type Input 1 CUSTOMER Numeric 2 TIME Numeric 3 PRODUCT Categoric Target Risk Ident Ignore Weight Survival Comment Unique: 1001 Unique: 7 Unique: 20 b) Now run the Association Tab specifying minimum Confidence and Support levels of 0.3. How many rules were generated? Is this useful? Data Explore Test Transform Cluster Associate Model Evaluate Log Baskets Support: 0.3000 Confidence: 0.3000 Min Length: 2 Freq Plot Show Rules Sort by: Support Plot c) Now run the Association Tab specifying minimum Confidence and Support levels of 0.25. How many rules were generated? Is this useful? d) Draw the Freq Plot and answer the following questions. What are the four most popular products and what proportion of people purchase each of these products. 1= 2= 3= 4= 0.5 0.4 - item frequency (relative) 3 0.2 - 0.1 0.0 wopies avocado baguete bourbon chicken cokg comed.b cracker ham heineken h??ng ica_crea peppers sandnes turkey e) Show the Rules and answer the following questions. All Rules 1hs rhs support confidence lift [1] { cracker} => {heineken} 0.3656344 0.7500000 1.251250 [2] {heineken} => {cracker} 0.3656344 0.6100000 1.251250 [3] {hering} => {heineken} 0.2877123 0.5925926 0.988642 [4] {heineken} => {hering} 0.2877123 0.4800000 0.988642 [5] {baguette} => {heineken} 0.2607393 0.6658163 1.110804 [6] {heineken} => {baguette} 0.2607393 0.4350000 1.110804 [7] { soda} => {heineken} 0.2567433 0.8081761 1.348307 [8] {heineken} => { soda} 0.2567433 0.4283333 1.348307 [9] {olives} 0.2557443 0.5412262 1.114748 => {hering} [10] {hering} => {olives} 0.2557443 0.5267490 1.114748 [11] {artichok} => {heineken} 0.2517483 0.8262295 1.378426 [12] {heineken} => {artichok} 0.2517483 0.4200000 1.378426 [13] {soda} => { cracker} 0.2507493 0.7893082 1.619052 [14] {cracker} => { soda } 1.619052 0.2507493 0.5143443 i) What is the probability that someone buys crackers and heineken? ii) What is the probability that someone who