-
Notifications
You must be signed in to change notification settings - Fork 627
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: do not fetch unused steps of runs in pr-curve page * fix: error when switch to overlay mode in histogram page * feat: pr-curve show all matched points in tooltip
- Loading branch information
1 parent
a31d235
commit e8c5887
Showing
13 changed files
with
89 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
export const nearestPoint = (data: number[][][], recall: number): number[][] => { | ||
export const nearestPoint = (data: number[][][], recall: number): number[][][] => { | ||
return data.map(series => { | ||
let delta = Number.POSITIVE_INFINITY; | ||
let index = 0; | ||
let nearestRecall = 0; | ||
for (let i = 0; i < series.length; i++) { | ||
if (series[i][1] - recall < Number.EPSILON) { | ||
return series[i]; | ||
const d = Math.abs(series[i][1] - recall); | ||
if (d < Number.EPSILON) { | ||
nearestRecall = series[i][1]; | ||
break; | ||
} | ||
if (Math.abs(series[i][1] - recall) < delta) { | ||
delta = Math.abs(series[i][1] - recall); | ||
index = i; | ||
if (d < delta) { | ||
delta = d; | ||
nearestRecall = series[i][1]; | ||
} | ||
} | ||
return series[index]; | ||
return series.filter(s => s[1] === nearestRecall); | ||
}); | ||
}; |