predict method

Mat predict(
  1. Mat samples, {
  2. int flags = 0,
})

Predicts the response for each row of samples, one row of the returned Mat per sample.

StatModel.RAW_OUTPUT is accepted as in predictProb.

Implementation

Mat predict(Mat samples, {int flags = 0}) {
  final p = calloc<ffi.Float>();
  final results = Mat.empty();
  try {
    cvRun(
      () => cml.cv_ml_NormalBayesClassifier_predict(ref, samples.ref, results.ref, flags, p, ffi.nullptr),
    );
    return results;
  } catch (_) {
    results.dispose();
    rethrow;
  } finally {
    calloc.free(p);
  }
}