• Home
  • Swinburne University of Technology
  • Data Mining
  • Installing and Using R, RStudio, and Rattle for Data Mining

Installing and Using R, RStudio, and Rattle for Data Mining

STA30004: Data Mining Tutorial 2019 Week 6 a) Installing R, then RStudio and finally rattle R and RStudio have already been installed in the computer lab but you may need to install them at home. We recommend the Melbourne(1) CRAN. (See https://www.r-project.org/ and https://www.rstudio.com/products/rstudio/download/). 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. The previous problem with Rattle has been fixed so the following should now work on any Windows platform. Windows > install. packages ("rattle") b) In RStudio command line enter the following one line at a time. > library(rattle) rattle() c) Click on Execute in the GUI and ask for weather.csv i) Check that Rattle has correctly guessed the data type for each variable. ii) Use the View button to see the worksheet. iii) Be careful with the Edit button. Document any changes. d) Assign appropriate roles i) RainTomorrow is the Target Variable. ii) Risk_MM=amount of rain tomorrow identified as a RISK variable by name iii) Date has an Identity role. iv) Location must be ignored because there is no useful information in this variable. Always set equal to "Canberra". v) All other variables should have an Input role 1 e) Run a tree assuming a loss matrix with losses 10 times greater for a false negative than a false positive. Answer the following questions after drawing your tree and asking for the corresponding rules. Observe no rain tomorrow Observe rain tomorrow FN=10 Predict no rain tomorrow TN=0 Data Explore Test Transform Cluster Associate Model Evaluate Log Type: @ Tree Forest Boost SVM Linear Neural Net Survival @ All Target: RainTomorrow Algorithm: Traditional Conditional Min Split: 20 Max Depth: 30 Priors: Min Bucket: 7 Complexity: 0.0100 Loss Matrix: 0,1,10,0 Predict rain tomorrow FP=1 TP=0 Model Builder: rpart Include Missing Rules Draw i) Consider node 4. What is the average loss per day if we make a Yes Rain Tomorrow Decision (FP)? What is the average loss per day if we make a No Rain Tomorrow Decision? Which is the better decision for this node? Based on your output answer this part ii) Consider node 3. What is the average loss per day if we make a Yes Rain Tomorrow Decision (FP)? What is the average loss per day if we make a No Rain Tomorrow Decision? Which is the better decision for this node? Based on your output answer this part f) Run a random forest with your data with 500 trees and randomly selecting four variables from which to choose your split variable at each node. i) What is the OOB estimate of the error rate: 13.67% ii) What does OOB mean? Rate of incorrectly classifying observation in the training dataset iii) What is the error rate