Added ndpi_find_outliers() API call using Z-Score

This commit is contained in:
Luca Deri
2022-04-04 10:02:45 +02:00
parent 19019383f0
commit a6e2f4a15a
3 changed files with 76 additions and 0 deletions
+15
View File
@@ -1558,6 +1558,7 @@ extern "C" {
float ndpi_data_entropy(struct ndpi_analyze_struct *s);
float ndpi_data_variance(struct ndpi_analyze_struct *s);
float ndpi_data_stddev(struct ndpi_analyze_struct *s);
float ndpi_data_mean(struct ndpi_analyze_struct *s);
u_int32_t ndpi_data_last(struct ndpi_analyze_struct *s);
u_int32_t ndpi_data_min(struct ndpi_analyze_struct *s);
u_int32_t ndpi_data_max(struct ndpi_analyze_struct *s);
@@ -1653,6 +1654,20 @@ extern "C" {
/* ******************************* */
/*
* Finds outliers using Z-score
* Z-Score = (Value - Mean) / StdDev
*
* @par values = pointer to the individual values to be analyzed [in]
* @par outliers = pointer to a list of outliers identified [out]
* @par num_values = lenght of values and outliers that MUST have the same lenght [in]
*
* @return The number of outliers found
*/
u_int ndpi_find_outliers(u_int32_t *values, bool *outliers, u_int32_t num_values);
/* ******************************* */
u_int32_t ndpi_quick_16_byte_hash(u_int8_t *in_16_bytes_long);
/* ******************************* */