hex.glm
Class GLMTask.GLMIterationTask

java.lang.Object
  extended by jsr166y.ForkJoinTask<java.lang.Void>
      extended by jsr166y.CountedCompleter
          extended by water.H2O.H2OCountedCompleter
              extended by water.DTask
                  extended by water.MRTask2<T>
                      extended by hex.FrameTask<T>
                          extended by hex.glm.GLMTask<GLMTask.GLMIterationTask>
                              extended by hex.glm.GLMTask.GLMIterationTask
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.concurrent.Future<java.lang.Void>, Freezable
Enclosing class:
GLMTask<T extends GLMTask<T>>

public static class GLMTask.GLMIterationTask
extends GLMTask<GLMTask.GLMIterationTask>

One iteration of glm, computes weighted gram matrix and t(x)*y vector and t(y)*y scalar.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class hex.glm.GLMTask
GLMTask.GLMIterationTask
 
Field Summary
 
Fields inherited from class hex.glm.GLMTask
_beta, _caseMode, _caseVal
 
Fields inherited from class hex.FrameTask
_catOffsets, _cats, _nums, _standardize
 
Fields inherited from class water.MRTask2
_fr, _fs, _hi, _left, _lo, _nleft, _nodes, _nrite, _outputFrame, _rite, _topLocal
 
Fields inherited from class water.DTask
_cls, _eFromNode, _exception, _fname, _lineNum, _msg, _mth
 
Constructor Summary
GLMTask.GLMIterationTask(GLMTask.GLMIterationTask git, double[] beta)
           
GLMTask.GLMIterationTask(Job job, GLMParams glm, double[] beta, boolean standardize, double reg, GLMParams.CaseMode caseMode, double caseVal, int step, int offset, boolean complement)
           
 
Method Summary
protected  void chunkDone()
          Override this to do post-chunk processing work.
protected  void chunkInit()
          Override this to initialize at the beginning of chunk processing.
 void processRow(double[] nums, int ncats, int[] cats, double y)
          Method to process one row of the data for GLM functions.
 void reduce(GLMTask.GLMIterationTask git)
          Override to combine results from 'mrt' into 'this' MRTask2.
 
Methods inherited from class hex.glm.GLMTask
computeEta, diagN
 
Methods inherited from class hex.FrameTask
adaptFrame, catOffsets, cats, dfork2, doIt, fullN, largestCat, map, normMul, normSub, nums, processRow, standardize
 
Methods inherited from class water.MRTask2
clone, closeLocal, compute2, dfork, dfork, dfork, dfork, dinvoke, doAll, doAll, doAll, doAll, getResult, map, map, map, map, map, map, map, map, map, map, map, onCompletion, onExceptionalCompletion, postGlobal, profString, reduce4, setupLocal, vecs
 
Methods inherited from class water.DTask
copyOver, frozenType, getDException, hasException, logVerbose, newInstance, onAck, onAckAck, read, setException, toDocField, write, writeJSONFields
 
Methods inherited from class water.H2O.H2OCountedCompleter
compute, priority
 
Methods inherited from class jsr166y.CountedCompleter
addToPendingCount, compareAndSetPendingCount, complete, exec, getCompleter, getPendingCount, getRawResult, 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
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GLMTask.GLMIterationTask

public GLMTask.GLMIterationTask(Job job,
                                GLMParams glm,
                                double[] beta,
                                boolean standardize,
                                double reg,
                                GLMParams.CaseMode caseMode,
                                double caseVal,
                                int step,
                                int offset,
                                boolean complement)

GLMTask.GLMIterationTask

public GLMTask.GLMIterationTask(GLMTask.GLMIterationTask git,
                                double[] beta)
Method Detail

processRow

public final void processRow(double[] nums,
                             int ncats,
                             int[] cats,
                             double y)
Description copied from class: FrameTask
Method to process one row of the data for GLM functions. Numeric and categorical values are passed separately, as is reponse. Categoricals are passed as absolute indexes into the expanded beta vector, 0-levels are skipped (so the number of passed categoricals will not be the same for every row). Categorical expansion/indexing: Categoricals are placed in the beginning of the beta vector. Each cat variable with n levels is expanded into n-1 independent binary variables. Indexes in cats[] will point to the appropriate coefficient in the beta vector, so e.g. assume we have 2 categorical columns both with values A,B,C, then the following rows will have following indexes: A,A - ncats = 0, we do not pass any categorical here A,B - ncats = 1, indexes = [2] B,B - ncats = 2, indexes = [0,2] and so on

Overrides:
processRow in class FrameTask<GLMTask.GLMIterationTask>
Parameters:
nums - - numeric values of this row
ncats - - number of passed (non-zero) categoricals
cats - - indexes of categoricals into the expanded beta-vector.
y - - numeric value for the response

chunkInit

protected void chunkInit()
Description copied from class: FrameTask
Override this to initialize at the beginning of chunk processing.

Overrides:
chunkInit in class FrameTask<GLMTask.GLMIterationTask>

chunkDone

protected void chunkDone()
Description copied from class: FrameTask
Override this to do post-chunk processing work.

Overrides:
chunkDone in class FrameTask<GLMTask.GLMIterationTask>

reduce

public void reduce(GLMTask.GLMIterationTask git)
Description copied from class: MRTask2
Override to combine results from 'mrt' into 'this' MRTask2. Both 'this' and 'mrt' are guaranteed to either have map() run on them, or be the results of a prior reduce(). Reduce is optional if, e.g., the result is some output vector.

Overrides:
reduce in class MRTask2<GLMTask.GLMIterationTask>