Libraryless. Click here for Pure Java version (83L/1K).
1 | // converts the index of a correct guess in a probabilistic |
2 | // list to a score between 0 and 1 |
3 | |
4 | // properties: |
5 | // -index 0 gets score 1 |
6 | // -higher indices get lower scores |
7 | // -index -1 (not found) gets score 0 |
8 | static double scoreForIndexInProbabilisticList(int index) {
|
9 | ret index < 0 ? 0 : distanceToProbability(index); |
10 | } |
Began life as a copy of #1035312
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1035313 |
| Snippet name: | scoreForIndexInProbabilisticList |
| Eternal ID of this version: | #1035313/1 |
| Text MD5: | 5937aef0d3f6a07b49ff9e14d2523026 |
| Transpilation MD5: | 17acd1d328c3c355a4b1f65bcda0c919 |
| Author: | stefan |
| Category: | javax / maths |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-04-30 18:53:41 |
| Source code size: | 332 bytes / 10 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 369 / 469 |
| Referenced in: | [show references] |