This repository is used to share some L2R algorithms implemted by Python.
So far, this repository contains RankNet , LambdaRank and LambdaMART
I utilize Pytorch to implement the network structure.
In order to use the interface, you should input following parameters:
n_feaure
: int, features numbleh1_units
: int, the unit numbers of hidden layer1h2_units
: int, the unit numbers of hidden layer2epoch
: int, iteration timeslearning_rate
: float, learning rateplot
: boolean, whether plot the loss.
The usage is similar with RankNet.
This is a Python version of LambdaMART.
I implement it based on the code of lezzago
The dataset is the same as that of lezzago. I have preprocessed it and store in train.npy
and test.npy
.
You can directly used np.load()
to import dataset.
The first column is label
, the second column is qid
, and the following columns are features (total 46 features).