trainEAsync method

Future<(bool, Mat, Mat, Mat)> trainEAsync(
  1. Mat samples,
  2. Mat means0, {
  3. VecMat? covs0,
  4. Mat? weights0,
})

Implementation

Future<(bool, Mat logLikelihoods, Mat labels, Mat probs)> trainEAsync(
  Mat samples,
  Mat means0, {
  VecMat? covs0,
  Mat? weights0,
}) async {
  final covs = covs0 ?? VecMat();
  final weights = weights0 ?? Mat.empty();
  try {
    return await _emTrainAsync(
      (l, lb, pr, p, cb) =>
          cml.cv_ml_EM_trainE(ref, samples.ref, means0.ref, covs.ref, weights.ref, l, lb, pr, p, cb),
    );
  } finally {
    if (covs0 == null) covs.dispose();
    if (weights0 == null) weights.dispose();
  }
}