July 2017
Beginner to intermediate
715 pages
17h 3m
English
We will be using the Apriori Weka class to demonstrate Java support for the algorithm using two datasets. The first is the data discussed previously and the second deals with what a person may take on a hike.
The following is the data file, babies.arff, for baby information:
@relation TEST_ITEM_TRANS@attribute Diapers {1, 0}@attribute Lotion {1, 0}@attribute Wipes {1, 0}@attribute Formula {1, 0}@data1,1,1,01,1,1,10,1,1,01,0,0,00,1,1,1
We start by reading in the file using a BufferedReader instance. This object is used as the argument of the Instances class, which will hold the data:
try { BufferedReader br; br = new BufferedReader(new FileReader("babies.arff")); Instances ...Read now
Unlock full access