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.

flags may combine StatModel.RAW_OUTPUT and one of the DTrees.PREDICT_* flags.

Implementation

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