predict_topk: return wrong classes at position k

User 2574 | 6/9/2016, 6:57:13 PM

Comparing two outputs of calling predict_topk from the same model: a. k=5, outputtype = 'probability' b. k=5, outputtype = 'rank'

When I get the predicted results via output b, I see a constant label (or class) at position number 4 (as ranking starts from 0). What I mean by constant is that if you have a class called 'cat', at position 4, for every instance of the test data, 'cat' appears [not expected]. Whereas for a at position 4, I am getting different labels for different instances [as expected]. From position 0-3, the outputs of a (after sorting by probability) and b match. But at rank order 4, the two results a and b do not match.

Can you please try an multi class example of your own and see if you are getting something similar when your output is of type 'rank'.

[v 1.10]


User 1178 | 6/10/2016, 11:36:43 PM

Hi Javia,

Can you tell us which model you are using? And do you have a sample data that we can try to repro?



User 2574 | 6/11/2016, 5:33:02 AM

I will try to get a sample of the data. In terms of the model, I had used boosted trees classifier.

User 5306 | 6/19/2016, 4:32:58 PM

I have the same problem as Javiar. Seems that , predicttopk(data, outputtype='rank', k) returns a wrong class for rank=k. Using boostedtreesclassifier.create and v1.10.1

User 940 | 6/20/2016, 9:32:24 PM

Hi @AdrienR and @"Javiar Sandra" ,

Thanks for pointing this out. We'll be taking a look at this and will keep you posted.

Cheers! -Piotr

User 940 | 6/21/2016, 1:59:59 AM

Hi @AdrienR and @"Javiar Sandra" ,

We've identified the bug and are fixing it for the next release. Thanks for pointing it out!

Cheers! -Piotr