Libraryless. Click here for Pure Java version (2686L/17K).
1 | static <A> S renderUniquenessRatio(Cl<A> entries) { |
2 | if (empty(entries)) ret "no data"; |
3 | int total = l(entries), unique = countUniques(entries); |
4 | ret "Uniqueness ratio: " + formatDouble(doubleRatio(total, unique), 1) |
5 | + spaceRoundBracket(joinWithComma( |
6 | n2(total, "total entry", "total entries"), |
7 | n2(unique, "unique entry", "unique entries"))); |
8 | } |
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
Snippet ID: | #1030215 |
Snippet name: | renderUniquenessRatio |
Eternal ID of this version: | #1030215/4 |
Text MD5: | fa2a6f1eb6e2d4840dc1699a0720f73a |
Transpilation MD5: | bd0f2c1e179353d5fb10f88781012aad |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-11-17 11:25:49 |
Source code size: | 370 bytes / 8 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 211 / 312 |
Version history: | 3 change(s) |
Referenced in: | [show references] |