more useful options | |
PerlMonks |
Re^2: Groups of Objects with Common Attributesby Dev Null (Acolyte) |
on May 14, 2018 at 21:54 UTC ( [id://1214508]=note: print w/replies, xml ) | Need Help?? |
Thank you for your reply Alexander! Unfortunately, I don't think I was very clear in defining the problem, for which I apologize. You have counted up the number of occurrences of all the attributes, and returned the attribute with the highest number of hits. What I'm trying to do is feed it the entire list of objects (~500) and a size for a group (say, 4) and have it return for me the group or groups of 4 distinct objects that have the most attributes in common. So for my sample data from earlier, and a group size of 3, we'd look at all the permutations of 3 objects: (Ignoring sets of size 1 as uninteresting...) And then, depending on how we choose to score them, say that (apple, orange, pumpkin) was the best set, and (apple, orange, ball) next best.
In Section
Seekers of Perl Wisdom
|
|