From a6e2f4a15a52087ff3f2fa16bb990c998c5215a6 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Mon, 4 Apr 2022 10:02:45 +0200 Subject: Added ndpi_find_outliers() API call using Z-Score --- example/ndpiReader.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'example') diff --git a/example/ndpiReader.c b/example/ndpiReader.c index b957989e2..2b02a75db 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -5398,6 +5398,24 @@ void compressedBitmapUnitTest() { /* *********************************************** */ +void zscoreUnitTest() { + u_int32_t values[] = { 1, 3, 3, 4, 5, 2, 6, 7, 30, 16 }; + u_int32_t i; + u_int32_t num_outliers, num = sizeof(values) / sizeof(u_int32_t); + bool outliers[num], do_trace = false; + + num_outliers = ndpi_find_outliers(values, outliers, num); + + if(do_trace) { + printf("outliers: %u\n", num_outliers); + + for(i=0; i