Orange Forum • View topic - Question about Feature Subset Selection tutorial

Question about Feature Subset Selection tutorial

General discussions about Orange and with Orange connected things (data mining, machine learning, bioinformatics...).

Question about Feature Subset Selection tutorial

Postby sreastman » Thu Jan 10, 2013 21:10

I've been working my way through the last script in the Feature Subset tutorial and am puzzled about the way the variable "used" is used:

used = {}
for fold in range(results.numberOfIterations):
for att in results.classifiers[fold][1].domain.attributes:
a = att.name
if a in used.keys(): used[a] += 1
else: used[a] = 1
for a in used.keys():
print '%2d x %s' % (used[a], a)

I have not seen any documentation for the bracket pair, but assume "used" is set equal to the empty set. I have not been able to find any documentation for ".keys()". How does "used" get updated to where an "a" may be found by used.keys()? I've substituted another word for "used" and it still works.

Thanks for looking at this -- Steve

Re: Question about Feature Subset Selection tutorial

Postby sreastman » Thu Jan 10, 2013 22:51

Never mind. I looked around on the Python site and figured it out driving home this afternoon.

Steve


Return to General Discussions