Skip to content

Commit

Permalink
Small change in ranking usefullness
Browse files Browse the repository at this point in the history
  • Loading branch information
mmahdigh committed Sep 29, 2024
1 parent 124dfa9 commit 73892fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/mathematical-logic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const isRankingUseful = (ranking: number[]) => {
(score) => toFixedNumber(score, 3) <= 0.001,
).length;

if (numOfZeros > 0) return false;
if (numOfZeros > Math.round(ranking.length / 10)) return false;

const sortedRanking = [...ranking].sort();

Expand All @@ -54,6 +54,8 @@ const isRankingUseful = (ranking: number[]) => {
}
const max = sortedRanking[sortedRanking.length - 1];

if (toFixedNumber(median, 3) <= 0.001) return false;

if (max / median > 10) return false;

return true;
Expand Down

0 comments on commit 73892fe

Please sign in to comment.