()
| 98 | } |
| 99 | |
| 100 | @Test |
| 101 | public void testClone() |
| 102 | { |
| 103 | System.out.println("clone"); |
| 104 | |
| 105 | ClassificationDataSet t1 = FixedProblems.getSimpleKClassLinear(1000, 7); |
| 106 | ClassificationDataSet t2 = FixedProblems.getSimpleKClassLinear(1000, 9); |
| 107 | |
| 108 | OneVSOne instance = new OneVSOne(new DCDs()); |
| 109 | |
| 110 | instance = instance.clone(); |
| 111 | |
| 112 | instance.trainC(t1); |
| 113 | |
| 114 | OneVSOne result = instance.clone(); |
| 115 | for(int i = 0; i < t1.getSampleSize(); i++) |
| 116 | assertEquals(t1.getDataPointCategory(i), result.classify(t1.getDataPoint(i)).mostLikely()); |
| 117 | result.trainC(t2); |
| 118 | |
| 119 | for(int i = 0; i < t1.getSampleSize(); i++) |
| 120 | assertEquals(t1.getDataPointCategory(i), instance.classify(t1.getDataPoint(i)).mostLikely()); |
| 121 | |
| 122 | for(int i = 0; i < t2.getSampleSize(); i++) |
| 123 | assertEquals(t2.getDataPointCategory(i), result.classify(t2.getDataPoint(i)).mostLikely()); |
| 124 | } |
| 125 | } |
nothing calls this directly
no test coverage detected