hex.rf
Class Tree

java.lang.Object
  extended by jsr166y.ForkJoinTask<java.lang.Void>
      extended by jsr166y.CountedCompleter
          extended by water.H2O.H2OCountedCompleter
              extended by hex.rf.Tree
All Implemented Interfaces:
java.io.Serializable, java.util.concurrent.Future<java.lang.Void>

public class Tree
extends H2O.H2OCountedCompleter

See Also:
Serialized Form

Nested Class Summary
static class Tree.INode
           
static class Tree.StatType
           
static class Tree.TreeVisitor<T extends java.lang.Exception>
          Abstract visitor class for serialized trees.
 
Field Summary
static long LTS_INIT
           
static long LTSS_INIT
          Left and right seed initializer number for statistics
static int ROWS_FORK_TRESHOLD
          If the number of rows is higher then given number, fork-join is used to build subtrees, else subtrees are built sequentially
static long RTS_INIT
          Left and right seed initializer number for subtrees
static long RTSS_INIT
           
 
Constructor Summary
Tree(Job job, Data data, byte producerId, int maxDepth, Tree.StatType stat, int numSplitFeatures, long seed, int treeId, int exclusiveSplitLimit, Sampling sampler, int verbose)
          Constructor used to define the specs when building the tree from the top.
 
Method Summary
static double classify(AutoBuffer ts, double[] ds, double badat)
           
static short classify(AutoBuffer ts, ValueArray ary, AutoBuffer databits, int row, int[] modelDataMap, short badData)
          Classify this serialized tree - withOUT inflating it to a full tree.
 int classify(Data.Row r)
           
 void compute2()
           
static int dataId(byte[] bits)
           
static long depth_leaves(AutoBuffer tbits)
          Return (depth<<32)|(leaves), in 1 pass.
 int depth()
           
 int leaves()
           
 boolean onExceptionalCompletion(java.lang.Throwable ex, jsr166y.CountedCompleter _)
          Performs an action when method ForkJoinTask.completeExceptionally(java.lang.Throwable) is invoked or method CountedCompleter.compute() throws an exception, and this task has not otherwise already completed normally.
static byte producerId(byte[] bits)
           
static long seed(byte[] bits)
           
 Key toKey()
           
 java.lang.String toString()
           
 
Methods inherited from class water.H2O.H2OCountedCompleter
compute, priority
 
Methods inherited from class jsr166y.CountedCompleter
addToPendingCount, compareAndSetPendingCount, complete, exec, getCompleter, getPendingCount, getRawResult, onCompletion, setCompleter, setPendingCount, setRawResult, tryComplete
 
Methods inherited from class jsr166y.ForkJoinTask
adapt, adapt, adapt, cancel, compareAndSetForkJoinTaskTag, completeExceptionally, fork, get, get, getException, getForkJoinTaskTag, getPool, getQueuedTaskCount, getSurplusQueuedTaskCount, helpQuiesce, inForkJoinPool, invoke, invokeAll, invokeAll, invokeAll, isCancelled, isCompletedAbnormally, isCompletedNormally, isDone, join, peekNextLocalTask, pollNextLocalTask, pollTask, quietlyComplete, quietlyInvoke, quietlyJoin, reinitialize, setForkJoinTaskTag, tryUnfork
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LTSS_INIT

public static final long LTSS_INIT
Left and right seed initializer number for statistics

See Also:
Constant Field Values

RTSS_INIT

public static final long RTSS_INIT
See Also:
Constant Field Values

RTS_INIT

public static final long RTS_INIT
Left and right seed initializer number for subtrees

See Also:
Constant Field Values

LTS_INIT

public static final long LTS_INIT
See Also:
Constant Field Values

ROWS_FORK_TRESHOLD

public static final int ROWS_FORK_TRESHOLD
If the number of rows is higher then given number, fork-join is used to build subtrees, else subtrees are built sequentially

See Also:
Constant Field Values
Constructor Detail

Tree

public Tree(Job job,
            Data data,
            byte producerId,
            int maxDepth,
            Tree.StatType stat,
            int numSplitFeatures,
            long seed,
            int treeId,
            int exclusiveSplitLimit,
            Sampling sampler,
            int verbose)
Constructor used to define the specs when building the tree from the top.

Method Detail

onExceptionalCompletion

public boolean onExceptionalCompletion(java.lang.Throwable ex,
                                       jsr166y.CountedCompleter _)
Description copied from class: jsr166y.CountedCompleter
Performs an action when method ForkJoinTask.completeExceptionally(java.lang.Throwable) is invoked or method CountedCompleter.compute() throws an exception, and this task has not otherwise already completed normally. On entry to this method, this task ForkJoinTask.isCompletedAbnormally(). The return value of this method controls further propagation: If true and this task has a completer, then this completer is also completed exceptionally. The default implementation of this method does nothing except return true.

Overrides:
onExceptionalCompletion in class jsr166y.CountedCompleter
Parameters:
ex - the exception
_ - the task invoking this method (which may be this task itself).
Returns:
true if this exception should be propagated to this tasks completer, if one exists.

compute2

public void compute2()
Specified by:
compute2 in class H2O.H2OCountedCompleter

classify

public int classify(Data.Row r)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

leaves

public int leaves()

depth

public int depth()

toKey

public Key toKey()

classify

public static short classify(AutoBuffer ts,
                             ValueArray ary,
                             AutoBuffer databits,
                             int row,
                             int[] modelDataMap,
                             short badData)
Classify this serialized tree - withOUT inflating it to a full tree. Use row 'row' in the dataset 'ary' (with pre-fetched bits 'databits') Returns classes from 0 to N-1


classify

public static double classify(AutoBuffer ts,
                              double[] ds,
                              double badat)

dataId

public static int dataId(byte[] bits)

seed

public static long seed(byte[] bits)

producerId

public static byte producerId(byte[] bits)

depth_leaves

public static long depth_leaves(AutoBuffer tbits)
Return (depth<<32)|(leaves), in 1 pass.