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

Method testTrain_C

JSAT/test/jsat/classifiers/linear/ROMMATest.java:49–70  ·  view source on GitHub ↗

Test of supportsWeightedData method, of class ROMMA.

()

Source from the content-addressed store, hash-verified

47 * Test of supportsWeightedData method, of class ROMMA.
48 */
49 @Test
50 public void testTrain_C()
51 {
52 System.out.println("supportsWeightedData");
53 ROMMA nonAggro = new ROMMA();
54 ROMMA aggro = new ROMMA();
55 ClassificationDataSet train = FixedProblems.get2ClassLinear(200, RandomUtil.getRandom());
56
57 nonAggro.setEpochs(1);
58 nonAggro.trainC(train);
59
60 aggro.setEpochs(1);
61 aggro.trainC(train);
62
63 ClassificationDataSet test = FixedProblems.get2ClassLinear(200, RandomUtil.getRandom());
64
65 for(DataPointPair<Integer> dpp : test.getAsDPPList())
66 assertEquals(dpp.getPair().longValue(), aggro.classify(dpp.getDataPoint()).mostLikely());
67
68 for(DataPointPair<Integer> dpp : test.getAsDPPList())
69 assertEquals(dpp.getPair().longValue(), nonAggro.classify(dpp.getDataPoint()).mostLikely());
70 }
71}

Callers

nothing calls this directly

Calls 9

get2ClassLinearMethod · 0.95
getRandomMethod · 0.95
getAsDPPListMethod · 0.95
classifyMethod · 0.95
mostLikelyMethod · 0.80
trainCMethod · 0.65
setEpochsMethod · 0.45
getPairMethod · 0.45
getDataPointMethod · 0.45

Tested by

no test coverage detected