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

Method testMH

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

Source from the content-addressed store, hash-verified

14
15public class TestLogM extends TestCase {
16 public void testMH() {
17 final double[][] dat = {
18 /// x1 x2 y
19 { 1, 0, 1 },
20 { 1, 1, 1 },
21 { 0, 1, 0 }
22 };
23 final RExample ex = new RExample(dat);
24 final VectorFn sl = new DataFn<ExampleRow>(new SigmoidLossMultinomial(ex.dim,2),ex);
25 final double[] x0 = new double[sl.dim()];
26 for(int i=0;i<sl.dim();++i) {
27 x0[i] = i+1;
28 }
29 TestOpt.testGradAndHessian(sl,x0,1.0e-5,1.0e-2); // very sensitive to epsilon
30 }
31
32 public void testMHR() {
33 final double[][] dat = {

Callers

nothing calls this directly

Calls 2

dimMethod · 0.95
testGradAndHessianMethod · 0.95

Tested by

no test coverage detected