public AutoBuffer putJSONZ( String name, boolean value ) { putJSONStr(name).put1(':'); putJSONStr("" + value); return this; }
public AutoBuffer putJSONAStr(String name, String[] fs) { putJSONStr(name).put1(':'); return putJSONAStr(fs); } public AutoBuffer putJSONAStr(String[] fs) {
public AutoBuffer putJSONA4f(String name, float[] a) { putJSONStr(name).put1(':'); return putJSONA4f(a); } public AutoBuffer putJSONAA4f(String name, float[][] a) {
public AutoBuffer putJSONAAA8d( String name, double[][][] a ) { putJSONStr(name).put1(':'); return putJSONAAA8d(a); } public AutoBuffer putJSONAAA8d( double[][][] a ) {
public void send(H2ONode target) { assert this != none; new AutoBuffer(target).putUdp(udp.rebooted).put1(ordinal()).close(); } public void broadcast() { send(H2O.SELF); }
public Key toKey() { AutoBuffer bs = new AutoBuffer(); bs.put4(_data_id); bs.put8(_seed); bs.put1(_producerId); _tree.write(bs); Key key = Key.make((byte)1,Key.DFJ_INTERNAL_USER, H2O.SELF); DKV.put(key,new Value(key, bs.buf())); return key; }
public TreeModel.CompressedTree compress() { int sz = root().size(); if( root() instanceof LeafNode ) sz += 3; // Oops - tree-stump AutoBuffer ab = new AutoBuffer(sz); if( root() instanceof LeafNode ) // Oops - tree-stump ab.put1(0).put2((char)65535); // Flag it special so the decompress doesn't look for top-level decision root().compress(ab); // Compress whole tree assert ab.position() == sz; return new TreeModel.CompressedTree(ab.buf(),_nclass,_seed); } /** Save this tree into DKV store under default random Key. */
public CompressedTree compress(int tid, int cls, String[][] domains) { int sz = root().size(); if( root() instanceof LeafNode ) sz += 3; // Oops - tree-stump AutoBuffer ab = new AutoBuffer(sz); _abAux = new AutoBuffer(); if( root() instanceof LeafNode ) // Oops - tree-stump ab.put1(0).put2((char)65535); // Flag it special so the decompress doesn't look for top-level decision root().compress(ab, _abAux); // Compress whole tree assert ab.position() == sz; return new CompressedTree(ab.buf(), _seed,tid,cls); }