-
-
Notifications
You must be signed in to change notification settings - Fork 342
/
Copy pathml_model.h
50 lines (43 loc) · 1.35 KB
/
ml_model.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#pragma once
#include <stdlib.h>
#include <string>
#include <vector>
// include it here to allow user include only this single file
#include "brainflow_constants.h"
#include "brainflow_exception.h"
#include "brainflow_model_params.h"
#include "ml_module.h"
/// Calculates different metrics from raw data
class MLModel
{
private:
struct BrainFlowModelParams params;
std::string serialized_params;
public:
MLModel (struct BrainFlowModelParams params);
~MLModel ()
{
}
/// redirect logger to a file
static void set_log_file (std::string log_file);
/// enable ML logger with LEVEL_INFO
static void enable_ml_logger ();
/// disable ML loggers
static void disable_ml_logger ();
/// enable ML logger with LEVEL_TRACE
static void enable_dev_ml_logger ();
/// set log level
static void set_log_level (int log_level);
/// write user defined string to BrainFlow logger
static void log_message (int log_level, const char *format, ...);
/// release all currently prepared classifiers
static void release_all ();
/// get brainflow version
static std::string get_version ();
/// initialize classifier, should be called first
void prepare ();
/// calculate metric from data
std::vector<double> predict (double *data, int data_len);
/// release classifier
void release ();
};