@Test public void testCategoricalNode() throws Exception { Node node = new CategoricalNode(rng.nextInt(), new double[]{rng.nextDouble(), rng.nextDouble(), rng.nextDouble()}, new Node[]{ new Leaf(rng.nextDouble()), new Leaf(rng.nextDouble()), new Leaf(rng.nextDouble())}); node.write(out); assertEquals(node, readNode()); }
@Override public final void write(DataOutput out) throws IOException { out.writeInt(getType().ordinal()); writeNode(out); }
Node implements Writable { @Override public final void write(DataOutput out) throws IOException { out.writeInt(getType().ordinal()); writeNode(out); } }
Node implements Writable { @Override public final void write(DataOutput out) throws IOException { out.writeInt(getType().ordinal()); writeNode(out); }  }
Node implements Writable { @Override public final void write(DataOutput out) throws IOException { out.writeInt(getType().ordinal()); writeNode(out); }  abstract double classify(Instance instance); abstract long nbNodes(); abstract long maxDepth(); static Node read(DataInput in); @Override final String toString(); @Override final void write(DataOutput out); }
Node implements Writable { @Override public final void write(DataOutput out) throws IOException { out.writeInt(getType().ordinal()); writeNode(out); }  abstract double classify(Instance instance); abstract long nbNodes(); abstract long maxDepth(); static Node read(DataInput in); @Override final String toString(); @Override final void write(DataOutput out);  }