Package cc.mallet.types

Examples of cc.mallet.types.Multinomial$MEstimator


  }

  public void testMultinomial ()
  {
    double[] c = new double[] {.2, .3, .1, .4};
    Multinomial m = new Multinomial (c);
    assertTrue (m.probability (0) == .2);
  }
View Full Code Here


    Dirichlet dirichlet = new Dirichlet (new double[] { 1, 1, 1, 1 });

    FactorGraph mdl = new FactorGraph (vars);
    for (int i = 0; i < length - 1; i++) {
      Multinomial m = dirichlet.randomMultinomial (r);
      double[] probs = m.getValues ();
      mdl.addFactor (vars[i], vars[i + 1], probs);
    }

    return mdl;
  }
View Full Code Here

    return pr;
  }

  public Multinomial randomMultinomial (Randoms r)
  {
    return new Multinomial (randomRawMultinomial(r), dict, partition.length, false, false);
  }
View Full Code Here

    return new Dirichlet (pr, dict);
  }

  public FeatureSequence randomFeatureSequence (Randoms r, int length)
  {
    Multinomial m = randomMultinomial (r);
    return m.randomFeatureSequence (r, length);
  }
View Full Code Here

TOP

Related Classes of cc.mallet.types.Multinomial$MEstimator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.