You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm interested in the mean distribution of the error which i'm calling bias (over or under predicting).
I can do this as a one liner in numpy (np.average(y_pred - y_true)) but I would prefer to stay in scikit-learn.
Sorry @raybellwaves I don't really understand how this proposal differs from #17853?
It doesn't. I agree with the comment that it wouldn't make sense using an existing function and adding another keyword that doesn't align with the function. I probably should have changed the title of that issue rather than open a new one.
Why? You're using numpy already if you're using scikit-learn
I guess I would prefer a function that has been unit tested (in scikit-learn) rather than a custom function. However, I understand you have to draw a line somewhere with regards to custom metrics.
On one side, I think bias is a well established enough term for it to be included as a metric. On the other side, optimizing on bias is not something which we usually do when we search in the hyper parameter space.
Our GS can now handle multiple metrics easily and choose the best estimator based on a combination of them, so I guess it wouldn't be too bad to have bias as a metric?
Personally I +1 the comment by @thomasjpfan in #17853 that this isn't a good metric.
Has there been consensus on whether it is desired to be introduced in scikit-learn or not?
First of all, a one liner like np.average(y_pred - y_true) is not a good fit for inclusion. This one liner will need tests and documentation, thus a lot of maintenance burden. And in users' code, it will replace a one liner by another one liner. So where is the point? Therefore, I'm -1.
The other point is that, in my opinion, assessing bias or calibration is a very important topic for ML models, but it seems a bad fit for the metrics module because there you typically have scores for model comparison. Scores have an ordering (e.g. larger is better). Calibration, in general, is different (e.g. sign sensitive) because you want to know if your model over- or underpredicts. Otherwise stated, scores can be optimised, calibration is more like the first order optimality condition (the derivative).
Currently, we don't have good solutions to detect bias except for the reliability diagram/calibration curve for binary classification, further discussions e.g. in #18020.
Again, in my opinion, something that would be a good fit for the metrics module is #23767.
Activity
NicolasHug commentedon Jul 6, 2020
Sorry @raybellwaves I don't really understand how this proposal differs from #17853?
Why? You're using numpy already if you're using scikit-learn
raybellwaves commentedon Jul 6, 2020
It doesn't. I agree with the comment that it wouldn't make sense using an existing function and adding another keyword that doesn't align with the function. I probably should have changed the title of that issue rather than open a new one.
I guess I would prefer a function that has been unit tested (in scikit-learn) rather than a custom function. However, I understand you have to draw a line somewhere with regards to custom metrics.
adrinjalali commentedon Jul 9, 2020
On one side, I think bias is a well established enough term for it to be included as a metric. On the other side, optimizing on bias is not something which we usually do when we search in the hyper parameter space.
Our GS can now handle multiple metrics easily and choose the best estimator based on a combination of them, so I guess it wouldn't be too bad to have
biasas a metric?Kshitij68 commentedon Oct 15, 2022
Hi @lorentzenchr
Personally I +1 the comment by @thomasjpfan in #17853 that this isn't a good metric.
Has there been consensus on whether it is desired to be introduced in scikit-learn or not?
lorentzenchr commentedon Oct 15, 2022
First of all, a one liner like
np.average(y_pred - y_true)is not a good fit for inclusion. This one liner will need tests and documentation, thus a lot of maintenance burden. And in users' code, it will replace a one liner by another one liner. So where is the point? Therefore, I'm -1.The other point is that, in my opinion, assessing bias or calibration is a very important topic for ML models, but it seems a bad fit for the metrics module because there you typically have scores for model comparison. Scores have an ordering (e.g. larger is better). Calibration, in general, is different (e.g. sign sensitive) because you want to know if your model over- or underpredicts. Otherwise stated, scores can be optimised, calibration is more like the first order optimality condition (the derivative).
Currently, we don't have good solutions to detect bias except for the reliability diagram/calibration curve for binary classification, further discussions e.g. in #18020.
Again, in my opinion, something that would be a good fit for the metrics module is #23767.