Closed ablaom closed 1 year ago
This looks like a bug to me:
julia> y = rand(3); yhat = rand(3); w = rand(3); julia> value(L1DistLoss(), y, yhat, AggMode.WeightedMean(w, normalize=false)) 0.4515037807304132 julia> value(L1DistLoss(), y, yhat, AggMode.WeightedSum(w, normalize=false)) 0.4515037807304132
I believe the problem is with weighted mean:
julia> value(L1DistLoss(), [1, 2, 3], [2, 5, -2], AggMode.WeightedMean([1, 2, 1], normalize=false)) 12.0
The unweighed distances are [1, 3, 1]. So the weighted distances are [1, 6, 1], giving a weighed mean of (1 + 6 + 1) /(1 + 2 + 1) = 8/5 not 12, right?
[1, 3, 1]
[1, 6, 1]
(1 + 6 + 1) /(1 + 2 + 1) = 8/5
12
Definitely a bug @ablaom , sorry for only seeing this issue now. I am revamping the package for a new minor release and will try to fix this right away.
@juliohm Friendly reminder.
This looks like a bug to me:
I believe the problem is with weighted mean:
The unweighed distances are
[1, 3, 1]
. So the weighted distances are[1, 6, 1]
, giving a weighed mean of(1 + 6 + 1) /(1 + 2 + 1) = 8/5
not12
, right?