shiba24 / learning2rank

Learning to rank with neuralnet - RankNet and ListNet
481 stars 141 forks source link

Does this work with (almost) binary y's? #13

Open hedgy123 opened 6 years ago

hedgy123 commented 6 years ago

Hi,

Thanks so much for making your code available online!

I had a question: does your approach work if the y's are almost binary (very close to 0 or very close to 1)? Because I tried it and when I did

 from learning2rank.rank import RankNet, ListNet
 Model = RankNet.RankNet()
 Model.fit(X,y()
 predy = Model.predict(X)

 np.min(predy),np.max(predy)

I got 0.0, 0.0.

My X data consist of 6 features (float rankings of objects according to 6 different approaches), and about 100,000 rows. The y's are close to either 0 or 1, depending on whether the objects appeared in a gold standard dataset. I am not sure if the code is designed to work for this type of setup?

Thank you!

shiba24 commented 6 years ago

Thank you for the report, @hedgy123 !

When I implemented and used these codes, the features were not binary, including the number of page-views, the number of stars (favorites), etc. And it worked.

I am not sure for the (almost) binary dataset. However, it's a bit strange (not-expected) behavior to me, if even np.max(predy)==0.0. I can look into it on my PC later. Could you give me some samples of your data, if possible?