From 22dc446f8f0aa2ce3d0203c56ee0781c0ee28792 Mon Sep 17 00:00:00 2001 From: SpencerA Date: Mon, 18 Nov 2013 16:46:22 -0800 Subject: [PATCH] probability compute boilerplate --- src/main/java/hex/gbm/DTree.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/hex/gbm/DTree.java b/src/main/java/hex/gbm/DTree.java index c58822afa0..559849ca55 100644 --- a/src/main/java/hex/gbm/DTree.java +++ b/src/main/java/hex/gbm/DTree.java @@ -558,6 +558,11 @@ public void generateHTML(String title, StringBuilder sb) { "class=\'btn btn-inverse btn-mini\'>Java Model
" + "
"+DocGen.HTML.escape2(toJava())+"
"); } + File file = new File("/home/spencer/GBMScore.java"); + FileWriter fw = new FileWriter(file.getAbsoluteFile()); + BufferedWriter bw = new BufferedWriter(fw); + bw.write(toJava()); + bw.close(); String[] domain = _domains[_domains.length-1]; // Domain of response col // Top row of CM @@ -868,6 +873,10 @@ StringBuilder toString(final String res, CompressedTree ct, final StringBuilder }.visit(); sb.p(";\n"); } + sb.indent(2).p("// Compute Probabilities\n"); + sb.indent(2).p("float sum = 0;\n"); + sb.indent(2).p("for(int i=1;i