MCPcopy Index your code
hub / github.com/WinVector/Logistic / testMHR

Method testMHR

test/com/winvector/logistic/TestLogM.java:32–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30 }
31
32 public void testMHR() {
33 final double[][] dat = {
34 /// x1 x2 y
35 { 1, 0, 1 },
36 { 1, 1, 1 },
37 { 0, 1, 0 }
38 };
39 final RExample ex = new RExample(dat);
40 final VectorFn sl = NormPenalty.addPenalty(new DataFn<ExampleRow>(new SigmoidLossMultinomial(ex.dim,2),ex),0.1,null);
41 final double[] x0 = new double[sl.dim()];
42 for(int i=0;i<sl.dim();++i) {
43 x0[i] = i+1;
44 }
45 TestOpt.testGradAndHessian(sl,x0,1.0e-5,1.0e-2); // very sensitive to epsilon
46 }
47
48 /**
49 * chosen to run to infinity

Callers

nothing calls this directly

Calls 3

addPenaltyMethod · 0.95
dimMethod · 0.95
testGradAndHessianMethod · 0.95

Tested by

no test coverage detected