Skip to content

Provide an example of LightgbmRanker? #776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sharpwood opened this issue Aug 30, 2018 · 3 comments
Closed

Provide an example of LightgbmRanker? #776

sharpwood opened this issue Aug 30, 2018 · 3 comments
Assignees
Labels
documentation Related to documentation of ML.NET good first issue Good for newcomers
Milestone

Comments

@sharpwood
Copy link

sharpwood commented Aug 30, 2018

@codemzs

@Ivanidzo4ka Ivanidzo4ka added the documentation Related to documentation of ML.NET label Oct 19, 2018
@Zruty0
Copy link
Contributor

Zruty0 commented Oct 22, 2018

LightGBM should appear in the same way as other learners we have (SDCA, FastTree etc.)
Write xmldoc for it in the source code.

@Zruty0 Zruty0 added enhancement New feature or request and removed documentation Related to documentation of ML.NET labels Oct 22, 2018
@justinormont
Copy link
Contributor

When making an example... ranking has a few differences vs. Regression/Classification tasks:

  • Sorted/grouped dataset (all examples from the same group need to be next to each other)
  • GroupId is required
  • Label is one of { 0, 1, 2, 3, 4 }

There is a benchmark which includes LightGBMRanking:

[Benchmark]
public void TrainTest_Ranking_MSLRWeb10K_RawNumericFeatures_LightGBMRanking()
{
string cmd = @"TrainTest test=" + _mslrWeb10k_Validate +
" eval=RankingEvaluator{t=10}" +
" data=" + _mslrWeb10k_Train +
" loader=TextLoader{col=Label:R4:0 col=GroupId:TX:1 col=Features:R4:2-138}" +
" xf=HashTransform{col=GroupId}" +
" xf=NAHandleTransform{col=Features}" +
" tr=LightGBMRanking{}";
using (var environment = EnvironmentFactory.CreateRankingEnvironment<RankerEvaluator, TextLoader, HashTransformer, LightGbmMulticlassTrainer>())
{
Maml.MainCore(environment, cmd, alwaysPrintStacktrace: false);
}
}
}

It is written in the command-line language instead of C#. It would be nice to have a C# API ranking example.

@sfilipi
Copy link
Member

sfilipi commented Dec 3, 2018

A test for LightGBM ranker is here: https://github.com/dotnet/machinelearning/blob/master/test/Microsoft.ML.Tests/TrainerEstimators/TreeEstimators.cs#L116

Should convert it to an example.

@sfilipi sfilipi added help wanted good first issue Good for newcomers documentation Related to documentation of ML.NET and removed enhancement New feature or request labels Dec 3, 2018
@najeeb-kazmi najeeb-kazmi self-assigned this Feb 14, 2019
@shauheen shauheen added this to the 0219 milestone Feb 20, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Mar 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Related to documentation of ML.NET good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

7 participants