Package jline.api.mam

Class Mamap2m_fit_fb_multiclass

java.lang.Object
jline.api.mam.Mamap2m_fit_fb_multiclass

public final class Mamap2m_fit_fb_multiclass extends Object
Port of m3a mamap2m_fit_fb_multiclass.m: marks a second-order acyclic MAP in canonical form with m classes so that the class probabilities are matched exactly and the per-class forward and backward moments as closely as the form allows.

The marking probabilities q(j,c) of the three D1 entries are affine in the fitted moments, q(j,c) = fF(c) q_f(j,c) + fB(c) q_b(j,c) + q_0(j,c), so the fit is a strictly convex quadratic program, solved exactly by M3a_qp as MATLAB solves it with its Goldfarb-Idnani QP. Degenerate forms, where only F, only B or nothing can be fitted, take the reference's dedicated branches.

  • Method Details

    • mamap2m_fit_fb_multiclass

      public static Mamap2m_fit_fb_multiclass.FitResult mamap2m_fit_fb_multiclass(MatrixCell map, double[] p, double[] F, double[] B)
    • mamap2m_fit_fb_multiclass

      public static Mamap2m_fit_fb_multiclass.FitResult mamap2m_fit_fb_multiclass(MatrixCell map, double[] p, double[] F, double[] B, double[] classWeights, double[] fbWeights)
      Parameters:
      map - second-order acyclic MAP in canonical form 1 (gamma > 0) or 2 (gamma < 0)
      p - class probabilities
      F - target first-order forward moments
      B - target first-order backward moments
      classWeights - per-class weights (null for ones)
      fbWeights - weights of the forward and backward moments (null for ones)