master
h 28 lines 725 Bytes
Raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 #ifndef ML_FEATURES_H
4 #define ML_FEATURES_H
5
6 #include "ml_calculated_number.h"
7
8 #include <vector>
9
10 typedef struct {
11 size_t diff_n;
12 size_t smooth_n;
13 size_t lag_n;
14
15 calculated_number_t *dst;
16 size_t dst_n;
17
18 calculated_number_t *src;
19 size_t src_n;
20 } ml_features_t;
21
22 // Training path: diff + smooth + lag into preprocessed_features.
23 void ml_features_preprocess(ml_features_t *features, std::vector<DSample> &preprocessed_features, double sampling_ratio);
24
25 // Prediction path: diff + smooth, then fill a single DSample from the first lag_n+1 values.
26 void ml_features_preprocess_predict(ml_features_t *features, DSample &sample);
27
28 #endif /* ML_FEATURES_H */