de.bwaldvogel.liblinear
Class LinearTest

java.lang.Object
  extended by de.bwaldvogel.liblinear.LinearTest

public class LinearTest
extends Object


Constructor Summary
LinearTest()
           
 
Method Summary
static de.bwaldvogel.liblinear.Model createRandomModel()
           
static de.bwaldvogel.liblinear.Problem createRandomProblem(int numClasses)
           
static void disableDebugOutput()
           
 void testAtof()
           
 void testAtofInvalidData()
           
 void testAtoi()
           
 void testAtoiInvalidData()
           
 void testAtoiInvalidData2()
           
 void testAtoiInvalidData3()
           
 void testCrossValidation()
           
 void testLoadSaveModel()
           
 void testRealloc()
           
 void testSaveModelWithIOException()
           
 void testTrainPredict()
          create a very simple problem and check if the clearly separated examples are recognized as such
 void testTrainUnsortedProblem()
           
 void testTranspose()
          compared input/output values with the C version (1.51) IN: res prob.l = 4 res prob.n = 4 0: (2,1) (4,1) 1: (1,1) 2: (3,1) 3: (2,2) (3,1) (4,1) TRANSPOSED: res prob.l = 4 res prob.n = 4 0: (2,1) 1: (1,1) (4,2) 2: (3,1) (4,1) 3: (1,1) (4,1)
 void testTranspose2()
          compared input/output values with the C version (1.51) IN: res prob.l = 5 res prob.n = 10 0: (1,7) (3,3) (5,2) 1: (2,1) (4,5) (5,3) (7,4) (8,2) 2: (1,9) (3,1) (5,1) (10,7) 3: (1,2) (2,2) (3,9) (4,7) (5,8) (6,1) (7,5) (8,4) 4: (3,1) (10,3) TRANSPOSED: res prob.l = 5 res prob.n = 10 0: (1,7) (3,9) (4,2) 1: (2,1) (4,2) 2: (1,3) (3,1) (4,9) (5,1) 3: (2,5) (4,7) 4: (1,2) (2,3) (3,1) (4,8) 5: (4,1) 6: (2,4) (4,5) 7: (2,2) (4,4) 8: 9: (3,7) (5,3)
 void testTranspose3()
          compared input/output values with the C version (1.51) IN: res prob.l = 3 res prob.n = 4 0: (1,2) (3,1) (4,3) 1: (1,9) (2,7) (3,3) (4,3) 2: (2,1) TRANSPOSED: res prob.l = 3 * res prob.n = 4 0: (1,2) (2,9) 1: (2,7) (3,1) 2: (1,1) (2,3) 3: (1,3) (2,3)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearTest

public LinearTest()
Method Detail

disableDebugOutput

public static void disableDebugOutput()

createRandomModel

public static de.bwaldvogel.liblinear.Model createRandomModel()

createRandomProblem

public static de.bwaldvogel.liblinear.Problem createRandomProblem(int numClasses)

testRealloc

public void testRealloc()

testAtoi

public void testAtoi()

testAtoiInvalidData

public void testAtoiInvalidData()

testAtoiInvalidData2

public void testAtoiInvalidData2()

testAtoiInvalidData3

public void testAtoiInvalidData3()

testAtof

public void testAtof()

testAtofInvalidData

public void testAtofInvalidData()

testLoadSaveModel

public void testLoadSaveModel()
                       throws Exception
Throws:
Exception

testCrossValidation

public void testCrossValidation()
                         throws Exception
Throws:
Exception

testSaveModelWithIOException

public void testSaveModelWithIOException()
                                  throws Exception
Throws:
Exception

testTranspose

public void testTranspose()
                   throws Exception
compared input/output values with the C version (1.51)
 IN:
 res prob.l = 4
 res prob.n = 4
 0: (2,1) (4,1)
 1: (1,1)
 2: (3,1)
 3: (2,2) (3,1) (4,1)

 TRANSPOSED:

 res prob.l = 4
 res prob.n = 4
 0: (2,1)
 1: (1,1) (4,2)
 2: (3,1) (4,1)
 3: (1,1) (4,1)
 

Throws:
Exception

testTranspose2

public void testTranspose2()
                    throws Exception
compared input/output values with the C version (1.51)
 IN:
 res prob.l = 5
 res prob.n = 10
 0: (1,7) (3,3) (5,2)
 1: (2,1) (4,5) (5,3) (7,4) (8,2)
 2: (1,9) (3,1) (5,1) (10,7)
 3: (1,2) (2,2) (3,9) (4,7) (5,8) (6,1) (7,5) (8,4)
 4: (3,1) (10,3)

 TRANSPOSED:

 res prob.l = 5
 res prob.n = 10
 0: (1,7) (3,9) (4,2)
 1: (2,1) (4,2)
 2: (1,3) (3,1) (4,9) (5,1)
 3: (2,5) (4,7)
 4: (1,2) (2,3) (3,1) (4,8)
 5: (4,1)
 6: (2,4) (4,5)
 7: (2,2) (4,4)
 8:
 9: (3,7) (5,3)
 

Throws:
Exception

testTranspose3

public void testTranspose3()
                    throws Exception
compared input/output values with the C version (1.51) IN: res prob.l = 3 res prob.n = 4 0: (1,2) (3,1) (4,3) 1: (1,9) (2,7) (3,3) (4,3) 2: (2,1) TRANSPOSED: res prob.l = 3 * res prob.n = 4 0: (1,2) (2,9) 1: (2,7) (3,1) 2: (1,1) (2,3) 3: (1,3) (2,3)

Throws:
Exception

testTrainPredict

public void testTrainPredict()
create a very simple problem and check if the clearly separated examples are recognized as such


testTrainUnsortedProblem

public void testTrainUnsortedProblem()


Copyright © 2011. All Rights Reserved.