Skip to content
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

feat: add custom objective function to lightgbm learners #1054

Merged
merged 1 commit into from
May 25, 2021

Conversation

imatiach-msft
Copy link
Contributor

@imatiach-msft imatiach-msft commented May 20, 2021

add support for custom objective function in lightgbm learners

Users in the scala API will now be able to supply a custom loss function for training, which will need to output the gradient and hessian matrix.

As part of this PR, the LightGBMBooster and LightGBMDataset classes have been improved and moved under the booster and dataset folders, and some of the files related to parameters have been moved to a separate params folder in order to organize the code better since there are so many files in lightgbm directory.

TODO: add pyspark support, in a separate PR

@imatiach-msft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@codecov
Copy link

codecov bot commented May 20, 2021

Codecov Report

Merging #1054 (c870b60) into master (d8bb51f) will increase coverage by 0.05%.
The diff coverage is 83.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1054      +/-   ##
==========================================
+ Coverage   84.91%   84.96%   +0.05%     
==========================================
  Files         203      206       +3     
  Lines        9685     9744      +59     
  Branches      564      558       -6     
==========================================
+ Hits         8224     8279      +55     
- Misses       1461     1465       +4     
Impacted Files Coverage Δ
...osoft/ml/spark/lightgbm/LightGBMModelMethods.scala 66.66% <ø> (ø)
...l/spark/lightgbm/params/LightGBMBoosterParam.scala 100.00% <ø> (ø)
...m/microsoft/ml/spark/lightgbm/LightGBMRanker.scala 63.63% <50.00%> (+0.55%) ⬆️
...icrosoft/ml/spark/lightgbm/LightGBMRegressor.scala 72.22% <66.66%> (ø)
...ft/ml/spark/lightgbm/booster/LightGBMBooster.scala 87.86% <79.41%> (ø)
...ft/ml/spark/lightgbm/dataset/LightGBMDataset.scala 83.75% <86.20%> (ø)
...a/com/microsoft/ml/spark/lightgbm/TrainUtils.scala 87.50% <86.53%> (+0.85%) ⬆️
src/main/scala/com/microsoft/lightgbm/SWIG.scala 100.00% <100.00%> (ø)
...com/microsoft/ml/spark/lightgbm/LightGBMBase.scala 92.85% <100.00%> (+0.08%) ⬆️
...crosoft/ml/spark/lightgbm/LightGBMClassifier.scala 91.01% <100.00%> (ø)
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d8bb51f...c870b60. Read the comment docs.

@imatiach-msft imatiach-msft force-pushed the ilmat/custom-obj branch 2 times, most recently from c59741d to 0ae1fd9 Compare May 24, 2021 20:52
@imatiach-msft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@imatiach-msft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@imatiach-msft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@imatiach-msft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@imatiach-msft imatiach-msft force-pushed the ilmat/custom-obj branch 2 times, most recently from c25c330 to a8e6e51 Compare May 24, 2021 21:35
@imatiach-msft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@imatiach-msft imatiach-msft force-pushed the ilmat/custom-obj branch 3 times, most recently from 99bdb64 to 8359acd Compare May 24, 2021 22:39
@imatiach-msft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@imatiach-msft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

mhamilton723
mhamilton723 previously approved these changes May 25, 2021
@imatiach-msft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@imatiach-msft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@imatiach-msft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants