MCPcopy Create free account
hub / github.com/brainflow-dev/brainflow / string_to_brainflow_model_params

Function string_to_brainflow_model_params

src/ml/ml_module.cpp:127–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127int string_to_brainflow_model_params (const char *json_params, struct BrainFlowModelParams *params)
128{
129 // input string -> json -> struct BrainFlowModelParams
130 try
131 {
132 json config = json::parse (std::string (json_params));
133 params->metric = config["metric"];
134 params->classifier = config["classifier"];
135 params->file = config["file"];
136 params->output_name = config["output_name"];
137 params->other_info = config["other_info"];
138 params->max_array_size = config["max_array_size"];
139 return (int)BrainFlowExitCodes::STATUS_OK;
140 }
141 catch (json::exception &e)
142 {
143 BaseClassifier::ml_logger->error (
144 "Unable to create Brainflow model params with these arguments. Exception: {}",
145 e.what ());
146 return (int)BrainFlowExitCodes::INVALID_ARGUMENTS_ERROR;
147 }
148}
149
150int log_message_ml_module (int log_level, char *log_message)
151{

Callers 3

prepareFunction · 0.85
predictFunction · 0.85
releaseFunction · 0.85

Calls 1

whatMethod · 0.80

Tested by

no test coverage detected