Test of clone method, of class AMM.
()
| 81 | * Test of clone method, of class AMM. |
| 82 | */ |
| 83 | @Test |
| 84 | public void testClone() |
| 85 | { |
| 86 | System.out.println("clone"); |
| 87 | |
| 88 | ClassificationDataSet t1 = FixedProblems.getSimpleKClassLinear(10000, 2, RandomUtil.getRandom()); |
| 89 | ClassificationDataSet t2 = FixedProblems.getSimpleKClassLinear(10000, 2, RandomUtil.getRandom()); |
| 90 | |
| 91 | CPM instance = new CPM(2, 20, 1.5, 50); |
| 92 | |
| 93 | instance = instance.clone(); |
| 94 | |
| 95 | instance.trainC(t1); |
| 96 | |
| 97 | CPM result = instance.clone(); |
| 98 | result.trainC(t2); |
| 99 | |
| 100 | for(int i = 0; i < t1.getSampleSize(); i++) |
| 101 | assertEquals(t1.getDataPointCategory(i), instance.classify(t1.getDataPoint(i)).mostLikely()); |
| 102 | |
| 103 | for(int i = 0; i < t2.getSampleSize(); i++) |
| 104 | assertEquals(t2.getDataPointCategory(i), result.classify(t2.getDataPoint(i)).mostLikely()); |
| 105 | } |
| 106 | |
| 107 | } |
nothing calls this directly
no test coverage detected