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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user