calhoun.analysis.crf.test
Class ValidPathsTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by calhoun.util.AbstractTestCase
              extended by calhoun.analysis.crf.test.ValidPathsTest
All Implemented Interfaces:
junit.framework.Test

public class ValidPathsTest
extends AbstractTestCase

Tests that CRF is working with valid probabilities - the sum of all possible labelings is 1. Test that the code to walk through only the valid paths works correctly. Uses a two state model that disallows transitions to self. 010101... or 101010... are the only allowed paths.


Constructor Summary
ValidPathsTest()
           
 
Method Summary
 void testRejectInvalidTrainingPath()
           
 void testSumPaths()
          Tests that the sum of the likelihoods of the valid paths is 1
 void testSumPathsAllPaths()
          Tests all 2-state combinations with a restricted model and onlyValidTransitions = false
 void testSumPathsAllPathsCached()
          Tests all 2-state combinations with a restricted model and onlyValidTransitions = false
 void testSumPathsMoreComplicated()
          Tests that the sum of the likelihoods of the valid paths is 1, uses a model that allows 0-0
 
Methods inherited from class calhoun.util.AbstractTestCase
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertBeginsWith, assertEndsWith, assertEquals, assertFilesMatch, assertFlatFileRecordsMatch, assertStringEquals, assertStringEquals, assertXmlFilesMatch, runBare
 
Methods inherited from class junit.framework.TestCase
countTestCases, getName, run, run, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValidPathsTest

public ValidPathsTest()
Method Detail

testSumPathsAllPaths

public void testSumPathsAllPaths()
                          throws java.lang.Exception
Tests all 2-state combinations with a restricted model and onlyValidTransitions = false

Throws:
java.lang.Exception

testSumPathsAllPathsCached

public void testSumPathsAllPathsCached()
                                throws java.lang.Exception
Tests all 2-state combinations with a restricted model and onlyValidTransitions = false

Throws:
java.lang.Exception

testSumPaths

public void testSumPaths()
                  throws java.lang.Exception
Tests that the sum of the likelihoods of the valid paths is 1

Throws:
java.lang.Exception

testSumPathsMoreComplicated

public void testSumPathsMoreComplicated()
                                 throws java.lang.Exception
Tests that the sum of the likelihoods of the valid paths is 1, uses a model that allows 0-0

Throws:
java.lang.Exception

testRejectInvalidTrainingPath

public void testRejectInvalidTrainingPath()
                                   throws java.lang.Exception
Throws:
java.lang.Exception