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

Method predict

python_package/brainflow/ml_model.py:274–287  ·  view source on GitHub ↗

calculate metric from data :param data: input array :type data: NDArray[Shape["*"], Float64] :return: metric value :rtype: List

(self, data)

Source from the content-addressed store, hash-verified

272 raise BrainFlowError('unable to release classifier', res)
273
274 def predict(self, data) -> List:
275 """calculate metric from data
276
277 :param data: input array
278 :type data: NDArray[Shape["*"], Float64]
279 :return: metric value
280 :rtype: List
281 """
282 output = numpy.zeros(self.model_params.max_array_size).astype(numpy.float64)
283 output_len = numpy.zeros(1).astype(numpy.int32)
284 res = MLModuleDLL.get_instance().predict(data, data.shape[0], output, output_len, self.serialized_params)
285 if res != BrainFlowExitCodes.STATUS_OK.value:
286 raise BrainFlowError('unable to calc metric', res)
287 return output[0:output_len[0]]

Callers 2

mainFunction · 0.95
mainFunction · 0.95

Calls 3

BrainFlowErrorClass · 0.70
predictMethod · 0.65
get_instanceMethod · 0.45

Tested by

no test coverage detected