You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by jo...@apache.org on 2012/10/04 16:41:55 UTC
svn commit: r1394095 -
/opennlp/trunk/opennlp-maxent/src/test/java/opennlp/maxent/quasinewton/LogLikelihoodFunctionTest.java
Author: joern
Date: Thu Oct 4 14:41:54 2012
New Revision: 1394095
URL: http://svn.apache.org/viewvc?rev=1394095&view=rev
Log:
OPENNLP-338 last failing test fixed. Thanks to Hyosup Shim for providing a patch.
Modified:
opennlp/trunk/opennlp-maxent/src/test/java/opennlp/maxent/quasinewton/LogLikelihoodFunctionTest.java
Modified: opennlp/trunk/opennlp-maxent/src/test/java/opennlp/maxent/quasinewton/LogLikelihoodFunctionTest.java
URL: http://svn.apache.org/viewvc/opennlp/trunk/opennlp-maxent/src/test/java/opennlp/maxent/quasinewton/LogLikelihoodFunctionTest.java?rev=1394095&r1=1394094&r2=1394095&view=diff
==============================================================================
--- opennlp/trunk/opennlp-maxent/src/test/java/opennlp/maxent/quasinewton/LogLikelihoodFunctionTest.java (original)
+++ opennlp/trunk/opennlp-maxent/src/test/java/opennlp/maxent/quasinewton/LogLikelihoodFunctionTest.java Thu Oct 4 14:41:54 2012
@@ -108,8 +108,10 @@ public class LogLikelihoodFunctionTest {
DataIndexer testDataIndexer = new OnePassRealValueDataIndexer(rvfes1,1);
LogLikelihoodFunction objectFunction = new LogLikelihoodFunction(testDataIndexer);
// when
- double[] nonInitialPoint = new double[] { 2, 3, 2, 3, 3, 3, 2, 3, 2, 2 };
- double value = objectFunction.valueAt(nonInitialPoint);
+ double[] nonInitialPoint = new double[] { 3, 2, 3, 2, 3, 2, 3, 2, 3, 2 };
+ double value = objectFunction.valueAt(dealignDoubleArrayForTestData(nonInitialPoint,
+ testDataIndexer.getPredLabels(),
+ testDataIndexer.getOutcomeLabels()));
double expectedValue = -0.00000000285417;
// then
assertEquals(expectedValue, value, TOLERANCE02);