# Multilabel Classification With Ranking

I have a dataset as below:

     Key Attr1 Attr2 Attr3 Attr4 Attr5 Attr6
kd1 l1    l2     l3    l4   l5     l6
kd1 l1    l7     l8    l9   l5     l10
kd1 l11   l12    l13   l14  l5     l10
kd1 ..................................
.
.
.
kd2 ..................................
kd2 ..................................
.
.
kd3 ..................................
.
.
.


For each instance, I have multiple combinations of target outputs(Attr1-Attr6). Whenever I use multilabel libraries, I get a single combination of outputs.

I want a ranked list(top 3) of target label classifications for each key given as input.

For example:

predict('kd1') should return the following:

res = [ [l1,l7,l8,l9,l10], [l1,l2,l3,l4,l5,l6], [l11,l12,l13,l14,l5,l10] ]

Here res[0] is the best combination, res[1] is the second best combination and so on.

How do I go about that?

kd1 = l1 + l2 + l3 + l4 + l5 + l6

• so the order in dataframe matters, saying that kd1 = l1 + l2 + l3 + l4 + l5 + l6 is better then kd1 = l1 + l7 + l8 + l9 l5 + l10... and how much better? I think that it would be great to give an simple real-world example / illustrations. Is it like anmal describtion where atributes are eye, head, leg, etc.? – Jirka B. Jan 6 '19 at 10:16