2
$\begingroup$

I am using Weka 3.6 to do Association Rule mining. In our data set, each transaction is a word, and each letter in the word is an item. The rules that we are mining would be in the format of {a set of letters} -> {another set of letters}.

So far, I have formatted six transactions by representing the existence of a letter with '1' and the absence of a letter with '0', but this is giving me some unwanted rules. Specifically, I am getting rules where the absence of a letter implies the absence of another letter, e.g. C='0' ==> U='0'.

How do I filter out rules that represent the absence of items?


For what it's worth, here is my .arff file:

@relation transactions
@attribute A {'1','0'}
@attribute C {'1','0'}
@attribute D {'1','0'}
@attribute E {'1','0'}
@attribute I {'1','0'}
@attribute K {'1','0'}
@attribute M {'1','0'}
@attribute N {'1','0'}
@attribute O {'1','0'}
@attribute U {'1','0'}
@attribute Y {'1','0'}
@data
'0','0','0','1','0','1','1','1','1','0','1' %monkey
'0','0','1','1','0','1','0','1','1','0','1' %donkey
'1','0','0','1','0','1','1','0','0','0','0' %make
'0','1','0','0','0','1','1','0','0','1','1' %mucky
'0','1','0','1','1','1','0','1','1','0','0' %conkie
'1','0','0','0','0','1','1','1','1','0','1' %mankoy
$\endgroup$

2 Answers 2

2
$\begingroup$

you can try this:

   @RELATION ITEMS
   @ATTRIBUTE itemM {?,1}
   @ATTRIBUTE itemO {?,1}
   @ATTRIBUTE itemN {?,1}
   @ATTRIBUTE itemK {?,1}
   @ATTRIBUTE itemE {?,1}
   @ATTRIBUTE itemY {?,1}
   @ATTRIBUTE itemU {?,1}
   @ATTRIBUTE itemD {?,1}
   @ATTRIBUTE itemA {?,1}
   @ATTRIBUTE itemC {?,1}
   @ATTRIBUTE itemI {?,1}

   @DATA

1,1,1,1,1,1,?,?,?,?,?
?,1,1,1,1,1,?,1,?,?,?
1,?,?,1,1,?,?,?,1,?,?
1,?,?,1,?,1,1,?,?,1,?
?,1,1,1,1,?,?,?,?,1,1
1,1,1,1,?,1,?,?,1,?,? 

or it works too:

   @RELATION ITEMS
   @ATTRIBUTE itemM {M} 
   @ATTRIBUTE itemO {O}
   @ATTRIBUTE itemN {N}
   @ATTRIBUTE itemK {K}
   @ATTRIBUTE itemE {E}
   @ATTRIBUTE itemY {Y}
   @ATTRIBUTE itemU {U}
   @ATTRIBUTE itemD {D}
   @ATTRIBUTE itemA {A}
   @ATTRIBUTE itemC {C}
   @ATTRIBUTE itemI {I}

   @DATA

M,O,N,K,E,Y,?,?,?,?,?
?,O,N,K,E,Y,?,D,?,?,?
M,?,?,K,E,?,?,?,A,?,?
M,?,?,K,?,Y,U,?,?,C,?
?,O,N,K,E,?,?,?,?,C,I
M,O,N,K,?,Y,?,?,A,?,? 
$\endgroup$
1
$\begingroup$

I'm not sure if there is a more formal way of doing this, but replacing the '0' values with ? works for me.

Using the following .arff file works for me:

@relation transactions
@attribute A {'1','0'}
@attribute C {'1','0'}
@attribute D {'1','0'}
@attribute E {'1','0'}
@attribute I {'1','0'}
@attribute K {'1','0'}
@attribute M {'1','0'}
@attribute N {'1','0'}
@attribute O {'1','0'}
@attribute U {'1','0'}
@attribute Y {'1','0'}
@data
?,?,?,'1',?,'1','1','1','1',?,'1' %monkey
?,?,'1','1',?,'1',?,'1','1',?,'1' %donkey
'1',?,?,'1',?,'1','1',?,?,?,? %make
?,'1',?,?,?,'1','1',?,?,'1','1' %mucky
?,'1',?,'1','1','1',?,'1','1',?,? %conkie
'1',?,?,?,?,'1','1','1','1',?,'1' %mankoy
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.