|
|
@ -13,7 +13,7 @@ module RankKing
|
|
|
|
ratings = combo.map {|item| Rating.first(axis:, item:) || OS.rating }
|
|
|
|
ratings = combo.map {|item| Rating.first(axis:, item:) || OS.rating }
|
|
|
|
Math.sqrt(
|
|
|
|
Math.sqrt(
|
|
|
|
[ratings, ratings.reverse]
|
|
|
|
[ratings, ratings.reverse]
|
|
|
|
.map {|game| [game, OS.rate(game.map {[_1]}).flatten] }
|
|
|
|
.map {|game| [game, OS.rate(game).flatten] }
|
|
|
|
.sum {|pre,post| pre.zip(post).sum { (_1.sigma - _2.sigma)**2 }}
|
|
|
|
.sum {|pre,post| pre.zip(post).sum { (_1.sigma - _2.sigma)**2 }}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}.last
|
|
|
|
}.last
|
|
|
@ -23,7 +23,7 @@ module RankKing
|
|
|
|
fail unless [winner, loser].all? { _1.pool == axis.pool }
|
|
|
|
fail unless [winner, loser].all? { _1.pool == axis.pool }
|
|
|
|
|
|
|
|
|
|
|
|
game = [winner, loser].map { Rating.first(axis:, item: _1) || OS.rating }
|
|
|
|
game = [winner, loser].map { Rating.first(axis:, item: _1) || OS.rating }
|
|
|
|
result = OS.rate(game.map { [_1] }).flatten
|
|
|
|
result = OS.rate(game).flatten
|
|
|
|
|
|
|
|
|
|
|
|
DB.transaction do
|
|
|
|
DB.transaction do
|
|
|
|
Ranking.create(axis:, winner:, loser:)
|
|
|
|
Ranking.create(axis:, winner:, loser:)
|
|
|
|