getDecisionFunction method

(double, Mat, Mat) getDecisionFunction(
  1. int i
)

Retrieves the decision function i.

Returns the rho value, the weights alpha and the indices of the support vectors svidx.

Implementation

(double rho, Mat alpha, Mat svidx) getDecisionFunction(int i) {
  final p = calloc<ffi.Double>();
  final alpha = Mat.empty();
  final svidx = Mat.empty();
  try {
    cvRun(() => cml.cv_ml_SVM_getDecisionFunction(ref, i, alpha.ref, svidx.ref, p, ffi.nullptr));
    return (p.value, alpha, svidx);
  } catch (_) {
    alpha.dispose();
    svidx.dispose();
    rethrow;
  } finally {
    calloc.free(p);
  }
}