commit 9eb588d556635fc80c3899a4d7f03e45da72a757
parent 272040bb2e64425bb047d9bae6c88ec1b01602e7
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Sat, 4 Jan 2025 18:08:41 -0800
cleanup
Diffstat:
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/pkg/web/handlers/interceptors/chess.go b/pkg/web/handlers/interceptors/chess.go
@@ -1183,7 +1183,7 @@ func calcWeightedAccuracies(allWinPercents []float64, weights []float64) (float6
if i%2 != 0 {
acc, acc1 = acc1, acc
}
- accuracy := fromWinPercents(float64(acc), float64(acc1))
+ accuracy := fromWinPercents(acc, acc1)
el := [2]float64{accuracy, weights[i]}
if i%2 == 0 {
whites = append(whites, el)
@@ -1211,19 +1211,6 @@ func harmonicMean(arr [][2]float64) float64 {
return float64(len(vs)) / sm
}
-/**
- def harmonicMean(a: Iterable[Double]): Option[Double] =
- a.nonEmpty option {
- a.size / a.foldLeft(0d) { (acc, v) => acc + 1 / Math.max(1, v) }
- }
-
- def weightedMean(a: Iterable[(Double, Double)]): Option[Double] =
- a.nonEmpty so {
- a.foldLeft(0d -> 0d) { case ((av, aw), (v, w)) => (av + v * w, aw + w) } match
- case (v, w) => w != 0 option v / w
- }
-*/
-
func weightedMean(a [][2]float64) float64 {
vs := make([]float64, 0)
ws := make([]float64, 0)