MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / testClone

Method testClone

JSAT/test/jsat/classifiers/svm/extended/CPMTest.java:83–105  ·  view source on GitHub ↗

Test of clone method, of class AMM.

()

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls 9

getSimpleKClassLinearMethod · 0.95
getRandomMethod · 0.95
cloneMethod · 0.95
trainCMethod · 0.95
getSampleSizeMethod · 0.95
getDataPointCategoryMethod · 0.95
classifyMethod · 0.95
getDataPointMethod · 0.95
mostLikelyMethod · 0.80

Tested by

no test coverage detected