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
Implementing custom multi quantile loss. #2615
Comments
Hi @mat-ej ! Multi quantile loss is technically similar to multi classification -- single label, multiple predictions At the moment, it is impossible to train models with user-defined multi quantile loss because there is no way to specify prediction dimension For now, you may train a model for each quantile independently We will try to add a parameter to specify prediction dimension for user-defined regression losses soon |
great, looking forward to such an update |
I was able to hack around this by repeating the y vector as many times as needed and then using MultiTargetCustomObjective, e.g.
Interestingly, if a MultiTargetCustomObjective is used the approx and target comes in batches of N=1 (?) (Even though the method arguments are named approxes and targets) When I use normal CustomObjective with a single target, the approxes and targets come in batches N>>>1.
Q: Is this a design choice ? Now back to the original question of writing my own MQ loss.
Just to give some background: |
yep
i think yes, if you combine it with appropriate MultiTargetCustomMetric |
thanks for taking the time to reply to my questions. Only thing that I see happening is that the cross entropy loss if calculated per data point is very tricky and it is not the same cross entropy that would be calculated per "batch" of data points. Q1: Doesnt this difference of SingleTargetObjective vs MuiltiTargetObjective affect the behaviour of the classifier significantly ? Q2: Am I misunderstanding things and the MultiTargetRegressor / Classifier does indeed sum up / mean the per data point losses somewhere after the calculation and hence is indeed optimizing in the correct direction ? |
A1: no, this is related to different parallelization for single and multiple predictions losses A2: multi rmse normalizes by total sample weight A2: multi logloss/cross-entropy normalizes by total sample weight times target dimension |
Hi Catboost team,
first off, thanks for truly amazing library.
My question has to do with custom losses, I went through the following documentation file:
https://github.com/catboost/catboost/blob/master/catboost/tutorials/custom_loss/custom_loss_and_metric_tutorial.ipynb
This tutorial showcases custom "single regression" loss and custom "multi regression" loss.
Problem:
What I don't understand is how does multi quantile loss fit into this framework, it is indeed fit on a single dimension y vector - hence single regression, but the output is multiple outputs, (multi regression?).
I want to implement my own specific MQ loss that behaves in a similar way, that only single column y is needed but model outputs multiple values.
Q1: Can this be achieved ?
Q2: How exactly is MQ loss implemented ? (How does catboost know to output multiple values?)
Thanks in advance for being helpful. Apologies for asking possibly stupid question : )
catboost version: 1.2.3
Operating System: Mac OS
The text was updated successfully, but these errors were encountered: