# Learning to Rank?

**URL:** <https://discourse.julialang.org/t/learning-to-rank/80527>\
**Category:** Machine Learning\
**Created:** [May 5, 2022, 7:30am UTC](https://discourse.julialang.org/t/learning-to-rank/80527 "2022-05-05T07:30:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Billpete002](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/billpete002/32/35091_2.png) [@Billpete002](https://discourse.julialang.org/u/Billpete002)\
**Post date:** [May 5, 2022, 7:30am UTC](https://discourse.julialang.org/t/learning-to-rank/80527/1 "2022-05-05T07:30:36Z")

</div>

Hi, I am wondering if there is any package which has a 100% Julia “learning to rank” feature besides XGBoost.jl? (my dataset would be too wide if I did that).

I have checked MLRanking.jl but this is deprecated by 6 years.  
LightGBM.jl hasn’t imported this feature yet.  
CatBoost.jl just uses PyCall to run Conda to do it.  
JLBoost.jl is deprecated (2020) and doesn’t work with DataFrames 1.0

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [May 5, 2022, 7:55am UTC](https://discourse.julialang.org/t/learning-to-rank/80527/2 "2022-05-05T07:55:18Z")

</div>

Beware that “learning to rank” can have another meaning: in recent papers, it has been used to describe models which output permutations. I guess you mean ranking features according to their importance?

---

<div class="post-metadata">

**Author:** ![Billpete002](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/billpete002/32/35091_2.png) [@Billpete002](https://discourse.julialang.org/u/Billpete002)\
**Post date:** [May 5, 2022, 9:26am UTC](https://discourse.julialang.org/t/learning-to-rank/80527/3 "2022-05-05T09:26:23Z")

</div>

Yes, something like lightgbm.LGBMRanker() but for Julia.

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [May 5, 2022, 9:34am UTC](https://discourse.julialang.org/t/learning-to-rank/80527/4 "2022-05-05T09:34:11Z")

</div>

The most complete list of Julia ML models that I know is hosted by MLJ: [List of Supported Models · MLJ](https://alan-turing-institute.github.io/MLJ.jl/dev/list_of_supported_models/#model_list)  
Perhaps one of them has the functionality you’re looking for?

---

<div class="post-metadata">

**Author:** ![Billpete002](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/billpete002/32/35091_2.png) [@Billpete002](https://discourse.julialang.org/u/Billpete002)\
**Post date:** [May 5, 2022, 9:39am UTC](https://discourse.julialang.org/t/learning-to-rank/80527/5 "2022-05-05T09:39:48Z")

</div>

Thanks, I’ll go through it - though just by using the search/find feature I don’t see anything “rank” related.

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [May 5, 2022, 12:13pm UTC](https://discourse.julialang.org/t/learning-to-rank/80527/6 "2022-05-05T12:13:39Z")

</div>

You won’t necessarily find rank in the name, for instance random forests are known to provide feature rankings in a natural way

---

<div class="post-metadata">

**Author:** ![RoyiAvital](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/royiavital/32/571_2.png) [@RoyiAvital](https://discourse.julialang.org/u/RoyiAvital)\
**Post date:** [May 6, 2022, 10:51am UTC](https://discourse.julialang.org/t/learning-to-rank/80527/7 "2022-05-06T10:51:17Z")

</div>

I am not sure @Billpete002 means feature ranking.  
I I get the [example on StackOverflow](https://stackoverflow.com/questions/62555987) correctly, `lightgbm.LGBMRanker` is about [Learning to Rank](https://en.wikipedia.org/wiki/Learning_to_rank).

---

<div class="post-metadata">

**Author:** ![Billpete002](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/billpete002/32/35091_2.png) [@Billpete002](https://discourse.julialang.org/u/Billpete002)\
**Post date:** [May 6, 2022, 11:30am UTC](https://discourse.julialang.org/t/learning-to-rank/80527/8 "2022-05-06T11:30:02Z")

</div>

I took “features” as the results - but yes I mean LTR as per your wiki link.

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [May 6, 2022, 1:30pm UTC](https://discourse.julialang.org/t/learning-to-rank/80527/9 "2022-05-06T13:30:44Z")

</div>

Alright, this changes things! I don’t know if it is exactly what you want but my current research project allows you to take a non-differentiable operator, such as

```julia
ranking(x) = invperm(sortperm(x))

```

and insert it into a differentiable Flux model. See [https://github.com/axelparmentier/InferOpt.jl](https://github.com/axelparmentier/InferOpt.jl) for more details
