-
Notifications
You must be signed in to change notification settings - Fork 3
Upstream adjustments for Learners #1
Comments
@pat-s, thank you very much for your review and drawing attention to the adjustments of the mlr3learnerstemplate. I will have a closer look and implement them accordingly in the next week(s). Regarding your suggestions:
The ParamSet is already declared in the superclass "LightGBM" in its
The function However, in the current implementation users have full control over the cross-validation with the following 'switches' in the superclass:
If
|
TODOs:
|
@pat-s I revised the package accordingly and also removed the superclass. Unfortunately, now a new error is introduced during unit tests when calling the "expect_learner"-function: |
Thanks. Looks way cleaner already - we're getting there :) I've looked a bit deeper into the source code and ... oh dear, if there would be a price for implementing an algorithm in an extra complicated way they could compete with xgboost 😅
The reasons is that you had an In addition two example tasks fail the classif autotest because mlr3learners.lightgbm/R/LearnerClassifLightGBM.R Lines 616 to 624 in 91387f2
Questions
|
I have re-added the definition of 'n' here: https://github.com/mlr3learners/mlr3learners.lightgbm/blob/development/R/LearnerClassifLightGBM.R#L619 To answer your questions:
This is the implementation of lgb.train's eval parameter which also allows to provide custom metrics. I plan to provide some custom metrics with this package, which are currently not available by default with the learner. One custom metric, "rmsle" is already included. It can be provided to the learner in the following way: learner$param_set$values = mlr3misc::insert_named(
learner$param_set$values,
list(
"early_stopping_round" = 10,
"learning_rate" = 0.1,
"num_iterations" = 100,
"custom_eval" = mlr3learners.lightgbm::lgb_rmsle
))
For custom metrics, such as the "rmsle" custom metrics and future custom metrics.
To avoid confusion, I renamed
Yes, it has influence. When using
I did this directly in the code. If I understand this test correctly, I think that for lightgbm it would make more sense to check for the actual learning parameters, which are provided to |
If it only has affect for multiclass tests, you can set it during constrution for the tests. Otherwise exclude the multiclass tests and run them standalone outside the "autotest". Metrics Does it make sense to ship some metrics with a learner? I'd prefer to add these into mlr3measures but in the end this is your decision. If the measures are optional the {MLmetrics} could/should go into "Suggests" instead of "Imports" so that it is not auto-installed when installing the learner.
OK 🙂
I don't have an overview which functions of the upstream package contribute to the overall availability of Parameters for the mlr3learner. Also, if the Param is available in the learner why would it be excluded in the ParamTest then (?) 😄 Did you maybe misread it as "included" by change? |
Do the response variables of all multiclass tests have the same number of levels?
These metrics are required for the internal early stopping. Unfortunately, mlr3measures won't work there.
:) Think you are right. I adjusted the tests accordingly, however, they now fail for the parameters |
IDK, you would have to look that up in the mlr3 test helpers
Can the measures you use from the MLMetrics package be included into mlr3measures? You don't need to do this yourself but ask for it in the repo. Shouldn't be huge task and makes mlr3measures even better.
The latest paramtests fail because lightgbm was not installed? Haven't looked through previous runs though. |
RMSLE is already available via mlr3measures. The reason to integrate custom metrics here is more related to the required function design than the availibility of the measure. If I did not overlook it, the second metric 'area under the precision recall curve (PR-AUC)' is not yet available via
No, they fail when running them manually with lightgbm installed. Do they check all the arguments of the underlying function (here |
If all the measures stuff is so complicated and time-consuming in the end, I'd say just leave it like it is now and focus on more important things :) But it's up to you of course.
All top-level arguments of a function so |
Hi @kapsner,
we've made some upstream adjustments to all learners which I would like you to be aware of:
.onLoad()
and.onUnload()
function. You can c/p zzz.R from the mlr3learnerstemplateman
slot in the constructor of the learnertrain_internal
andpredict_internal
are now private methods with names.train()
andpredict()
man-roxygen
In addition I had a quick look over your code base. Note that this is not an extensive review:
lgb.cv
and ´lgb.train`? Looks like the first does an internal tuning whereas the latter leaves this to the user? These two should get their own class and result in two learners in the end - so that the user can decide which one to use.The text was updated successfully, but these errors were encountered: