LossFunctions.jl
LossFunctions.jl copied to clipboard
No difference between `WeightedMean` and `WeighedSum` when `normalize=false`
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], which has mean 8/3 not 12, right?
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.