O'Reilly logo

Practical Predictive Analytics by Ralph Winters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Method two – Creating a physical transactions file

Now that you know how to run association rules using the coerce to dataframe method, we will now illustrate the write to file method:

  • In the write to file method, each item is written to a separate line, along with the identifying key, which in our case is the InvoiceId

  • The advantage to the write to file method is that very large data files can be accumulated separately, and then combined together if needed

  • You can use the file.show function to display the contents of the file that will be input to the association rules algorithm:

setwd("C:/PracticalPredictiveAnalytics/Data")load("OnlineRetail.full.Rda")OnlineRetail <- OnlineRetail[1:100,]nrow(OnlineRetail)> [1] 268034 head(OnlineRetail) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required