feat: add calibrated health score and survival depth
This commit is contained in:
parent
bd56c1ec33
commit
6e177ce868
9 changed files with 1645 additions and 45 deletions
|
|
@ -13,6 +13,26 @@ bool onod_run(const char* test,
|
|||
size_t len,
|
||||
double* result /* length >= 3 */);
|
||||
|
||||
// Health score of a sample. NaN marks values that are not available.
|
||||
typedef struct {
|
||||
double p_combined; // calibrated p-value of all tests combined
|
||||
double score; // -log10(p_combined), capped at 12; < 2 pass, < 4 suspect
|
||||
int verdict; // 0 pass, 1 suspect, 2 fail, 3 insufficient data (< 256 bytes)
|
||||
int weakest; // index of the test with the lowest calibrated p, -1 if none
|
||||
double depth_bits; // log2 of the bits in the longest passing prefix
|
||||
bool depth_complete;// true if every prefix up to the whole sample passed
|
||||
double p_cal[15]; // calibrated p-value per test, NaN if skipped
|
||||
} OnodScore;
|
||||
|
||||
// Returns true on success. With depth, also computes the survival depth (up to 2x slower).
|
||||
bool onod_score(const uint8_t* samples,
|
||||
size_t len,
|
||||
bool depth,
|
||||
OnodScore* result);
|
||||
|
||||
// Name of test index 0..14 as used in OnodScore.p_cal, NULL past the last one.
|
||||
const char* onod_test_name(size_t index);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue