Package cc.mallet.types

Examples of cc.mallet.types.Multinomial.probability()


    e.increment (fs);
    assertTrue (e.size() == 10);

    Multinomial m = e.estimate ();
    assertTrue (m.size() == 10);
    assertTrue (m.probability (dict.lookupIndex ("a")) == (2.0+1)/(14.0+10));
    assertTrue (m.probability ("w") == (1.0+1)/(14.0+10));
    Multinomial.Logged ml = new Multinomial.Logged (m);
    assertTrue (m.logProbability ("w") == ml.logProbability ("w"));
  }
View Full Code Here


    assertTrue (e.size() == 10);

    Multinomial m = e.estimate ();
    assertTrue (m.size() == 10);
    assertTrue (m.probability (dict.lookupIndex ("a")) == (2.0+1)/(14.0+10));
    assertTrue (m.probability ("w") == (1.0+1)/(14.0+10));
    Multinomial.Logged ml = new Multinomial.Logged (m);
    assertTrue (m.logProbability ("w") == ml.logProbability ("w"));
  }

  public static Test suite ()
View Full Code Here

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

TOP
Copyright © 2018 www.massapi.com. 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.