adamingas / ordinalgbt

A package to build Gradient boosted trees for ordinal labels
https://ordinalgbt.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
14 stars 1 forks source link

Support for Loss Matrix (Cost Sensitive Classification) #10

Open RoyiAvital opened 5 months ago

RoyiAvital commented 5 months ago

Have you thought on the following case, Cost Sensitive Classification:

$$ \boldsymbol{L} = \begin{bmatrix} l \left( y = 1, \hat{y} = 1 \right) & l \left( y = 1, \hat{y} = 2 \right) & \dots & l \left( y = 1, \hat{y} = K \right) \\ l \left( y = 2, \hat{y} = 1 \right) & l \left( y = 2, \hat{y} = 2 \right) & \dots & l \left( y = 2, \hat{y} = K \right) \\ \vdots & \vdots & \vdots & \vdots \\ l \left( y = K, \hat{y} = 1 \right) & l \left( y = K, \hat{y} = 2 \right) & \dots & l \left( y = K, \hat{y} = K \right) \end{bmatrix} $$

Is there a way to implement is where the Gradient and Hessian are easy to calculate for LightGBM?

adamingas commented 2 months ago

Hello, sorry for not getting back to you, I don't receive notifications for issues and I need to fix that. Will take a look over the weekend to see if something like this could be implemented.

RoyiAvital commented 2 months ago

@adamingas , On Settings -> Notifications make sure you have GitHub in the list:

image

It would be great to have a package with Cost Sensitive classification.
Even just as a demo wrapper for XGBoost / LightGBM.