diff --git a/optuna_dashboard/ts/components/GraphRank.tsx b/optuna_dashboard/ts/components/GraphRank.tsx index 17731101..6030a722 100644 --- a/optuna_dashboard/ts/components/GraphRank.tsx +++ b/optuna_dashboard/ts/components/GraphRank.tsx @@ -275,9 +275,7 @@ const getOrderWithSameOrderAveraging = (values: number[]): number[] => { values.forEach((value) => { const first_index = sorted_values.indexOf(value) const last_index = sorted_values.lastIndexOf(value) - const sum_of_the_value = sorted_values - .slice(first_index, last_index + 1) - .reduce((a, b) => a + b, 0) + const sum_of_the_value = (first_index + last_index) * (last_index - first_index + 1) / 2 const rank = sum_of_the_value / (last_index - first_index + 1) ranks.push(rank) })