Added single exponential smoothing API

int ndpi_ses_init(struct ndpi_ses_struct *ses, double alpha, float significance);
int ndpi_ses_add_value(struct ndpi_ses_struct *ses, const u_int32_t _value, double *forecast, double *confidence_band);
This commit is contained in:
Luca Deri
2021-03-11 00:04:33 +01:00
parent 5b7fe1360a
commit 6833ee2bbe
4 changed files with 235 additions and 29 deletions
+5
View File
@@ -1474,6 +1474,11 @@ extern "C" {
/* ******************************* */
int ndpi_ses_init(struct ndpi_ses_struct *ses, double alpha, float significance);
int ndpi_ses_add_value(struct ndpi_ses_struct *ses, const u_int32_t _value, double *forecast, double *confidence_band);
/* ******************************* */
int ndpi_jitter_init(struct ndpi_jitter_struct *hw, u_int16_t num_periods);
void ndpi_jitter_free(struct ndpi_jitter_struct *hw);
float ndpi_jitter_add_value(struct ndpi_jitter_struct *s, const float value);
+11
View File
@@ -1663,6 +1663,17 @@ struct ndpi_hw_struct {
double *s;
};
struct ndpi_ses_struct {
struct {
double alpha, ro;
} params;
u_int32_t num_values;
double sum_square_error, last_forecast, last_value;
};
/* **************************************** */
/* Prototype used to define custom DGA detection function */
typedef int (*ndpi_custom_dga_predict_fctn)(const char* domain, int domain_length);