Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^2: Groups of Objects with Common Attributes

by Dev Null (Novice)
on May 14, 2018 at 21:54 UTC ( #1214508=note: print w/replies, xml ) Need Help??

in reply to Re: Groups of Objects with Common Attributes
in thread Groups of Objects with Common Attributes

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:

(apple, orange, pumpkin): orange: 2 round: 3 plant: 3 fruit: 2 (apple, orange, ball): red: 2 round: 3 plant: 2 fruit: 2 (apple, pumpkin, ball): red: 2 round: 3 plant:2 (orange, pumpkin, ball): orange: 2 round: 3 plant: 2
(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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1214508]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2018-07-21 19:06 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (450 votes). Check out past polls.