[mlpack-svn] r10350 - mlpack/trunk/src/mlpack/tests
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Tue Nov 22 14:17:27 EST 2011
Author: rcurtin
Date: 2011-11-22 14:17:27 -0500 (Tue, 22 Nov 2011)
New Revision: 10350
Modified:
mlpack/trunk/src/mlpack/tests/hmm_test.cpp
Log:
Make sure the state probability makes sense.
Modified: mlpack/trunk/src/mlpack/tests/hmm_test.cpp
===================================================================
--- mlpack/trunk/src/mlpack/tests/hmm_test.cpp 2011-11-22 19:13:20 UTC (rev 10349)
+++ mlpack/trunk/src/mlpack/tests/hmm_test.cpp 2011-11-22 19:17:27 UTC (rev 10350)
@@ -579,7 +579,12 @@
// Check that each prediction is right.
for (size_t i = 0; i < 1000; i++)
+ {
BOOST_REQUIRE_EQUAL(predictedClasses[i], classes[i]);
+
+ // The probability of the wrong class should be infinitesimal.
+ BOOST_REQUIRE_SMALL(stateProb((classes[i] + 1) % 2, i), 0.001);
+ }
}
/**
@@ -760,3 +765,4 @@
}
BOOST_AUTO_TEST_SUITE_END();
+
More information about the mlpack-svn
mailing list