supportData = {('nas','fat'): 0.5, ('nas'): 1.0, ('fat'):0.6, ('van'):0.72,
         ('jos'):0.55,('van','jos'):0.10}

L = [('nas','fat'),('van','jos')]

for freqSet in L:
H = [''.join(list(i)) for i in freqSet]

prunedH = [] #create new list to return
for conseq in H:
    freqsetlist = list(freqSet)
    freqsetlist.remove(conseq)

    conf = supportData[freqSet]/supportData[tuple(freqsetlist)[0]]
    if conf >= 0.5:
          print freqsetlist,'-->',conseq,'conf:',conf

When I run the code I only get:

['fat'] --> nas conf: 0.833333333333

['nas'] --> fat conf: 0.5

It seems the inner loop doesn't iterate and calculate the confidence for the second tuple in L i.e Inline Code Example Here ('Van','jos')

You may want to edit the code a bit; the indentation is off.

I was able to reproduce the results described, but without knowing what it means, or what it was supposed to come out with, I can't tell you why it isn't giving the desired results.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.