shiba24 / learning2rank

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

Examples of vector X and Y #18

Open Pryanic opened 5 years ago

Pryanic commented 5 years ago

Thank you for you code. But sorry, I don't understand how to use it. Could you please explain how to set up data for training in vector X and Y? Could you please provide more details?

whuissyxa commented 5 years ago

Hello, I have the same question. Have you got it?

speeding-motor commented 5 years ago

@whuissyxa I have the same question too , have you got it?

shiba24 commented 5 years ago

It's on README. https://github.com/shiba24/learning2rank#usage

X is numpy array with the shape of (num_samples, num_features) and y is numpy array with the shape of (num_samples, ). y is the score which you would like to rank based on (e.g., Sales of the products, page view, etc).

if you have any further questions, feel free to post it here. @jiasudemotuohe

Royisaboy commented 4 years ago

no qid/ group id is required?

shmed commented 4 years ago

@shiba24 , I'm also interested in the answer to the question @Royisaboy is asking. How can we do "listwise" training without being able to specify lists? Are we supposed to call "fit" multiple times in a row for all the lists we have? Or is it meant to be trained on a single very long list? Thank you

ahkimkoo commented 4 years ago

我也有疑问,希望能给出示例,谢谢。

Xinyu-Wu commented 4 years ago

I have the same question. And I have read README.

Model.fit(X, y) Here, X is numpy array with the shape of (num_samples, num_features) and y is numpy array with the shape of (num_samples, ). y is the score which you would like to rank based on (e.g., Sales of the products, page view, etc).

In my recommendation system, I got a recommended list. And I want to re-rank the list by adding more info. But I don't understand the data format of X, y in your code.

Can I directly set X with N_features, and y with only probabilities (such as 0/1), if the data is not divided into groups. Thank you.

wangzhiying-maomao commented 2 years ago

@shiba24, I have a question : Each problem has several documents. Does X contain all the document features of a problem, or can it contain all the document features of all problems? That is to say, when you train, do you just train one problem at a time or do you train all problems together. What would the X form look like if we could train it together. Suppose I now have two questions, qid1 contains four documents, each with a feature, and qid2 contains three documents, can I type X and y like this? X = np. Array ([[[1], [2], [3], [4]], [[2], [3], [5]]]), y = np. Array ([,2,1,1 [2], [1 0]])