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

Method testClone

JSAT/test/jsat/classifiers/OneVSOneTest.java:100–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls 8

getSimpleKClassLinearMethod · 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