fix : game elo estimation
This commit is contained in:
@@ -78,8 +78,12 @@ const getAccuracyWeights = (movesWinPercentage: number[]): number[] => {
|
||||
const getMovesAccuracy = (movesWinPercentage: number[]): number[] =>
|
||||
movesWinPercentage.slice(1).map((winPercent, index) => {
|
||||
const lastWinPercent = movesWinPercentage[index];
|
||||
const winDiff = Math.abs(lastWinPercent - winPercent);
|
||||
const isWhiteMove = index % 2 === 0;
|
||||
const winDiff = isWhiteMove
|
||||
? Math.max(0, lastWinPercent - winPercent)
|
||||
: Math.max(0, winPercent - lastWinPercent);
|
||||
|
||||
// Source: https://github.com/lichess-org/lila/blob/a320a93b68dabee862b8093b1b2acdfe132b9966/modules/analyse/src/main/AccuracyPercent.scala#L44
|
||||
const rawAccuracy =
|
||||
103.1668100711649 * Math.exp(-0.04354415386753951 * winDiff) -
|
||||
3.166924740191411;
|
||||
|
||||
Reference in New Issue
Block a user