predict method
Predicts the response for each row of samples, one row of the returned Mat per sample.
flags is ignored by this model.
Implementation
Mat predict(Mat samples, {int flags = 0}) {
final p = calloc<ffi.Float>();
final results = Mat.empty();
try {
cvRun(() => cml.cv_ml_KNearest_predict(ref, samples.ref, results.ref, flags, p, ffi.nullptr));
return results;
} catch (_) {
results.dispose();
rethrow;
} finally {
calloc.free(p);
}
}