ML Algorithm for getting top pick in each sample I have a dataset of streets - and each street contains several houses.
street_id | house_id | number of calls | number of people living | etc...
1         | 1        | 10              | 5
1         | 2        | 3               | 1
2         | 3        | 4               | 2
2         | 4        | 15              | 19


My goal is to find for each street, the most popular house.
I have GT - streets with several houses, and for each street, which house was the most popular house.
For the data example above - the results should be (street 1 -&gt; house 1, street 2 -&gt; house 4) because houses #1, #4 are the most popular in their street.
Popular will be determined with classification algorithm - we have much more features than the 2 above (they are just for example). That's why we have the GT for - so our algorithm can learn what popular is.

We can find the most popular street using features about each house -

number of calls made from house
number of people living in house
etc

But we don't need to find all of the popular houses from all of the houses - we need for each street, to find the most popular house.
Do you know how can I solve this task?
I've thought about regular classification, but that would results giving all of the popular houses, and not one for each street.
Thanks in advance!
You will have to restructure your data in such a way that one input contains data pertaining to only one street (but of all the houses.) This involves grouping the data by street_id.
You should then use several inputs in such a way to train your model to find out the popular house. Since it will be a supervised-learning task, you'll have to label your data accordingly.
But there's a problem here. Each street has different number of houses. One way to handle this problem is by fixing an upper bound on the number of houses per street and padding your data up to this upper bound.