public class NodeIdCache
extends Object
Constructor and Description |
---|
NodeIdCache(RDD<int[]> nodeIdsForInstances,
int checkpointInterval) |
Modifier and Type | Method and Description |
---|---|
int |
checkpointInterval() |
void |
deleteAllCheckpoints()
Call this after training is finished to delete any remaining checkpoints.
|
static NodeIdCache |
init(RDD<BaggedPoint<TreePoint>> data,
int numTrees,
int checkpointInterval,
int initVal)
Initialize the node Id cache with initial node Id values.
|
RDD<int[]> |
nodeIdsForInstances() |
void |
updateNodeIndices(RDD<BaggedPoint<TreePoint>> data,
scala.collection.mutable.Map<Object,NodeIndexUpdater>[] nodeIdUpdaters,
Bin[][] bins)
Update the node index values in the cache.
|
public NodeIdCache(RDD<int[]> nodeIdsForInstances, int checkpointInterval)
public static NodeIdCache init(RDD<BaggedPoint<TreePoint>> data, int numTrees, int checkpointInterval, int initVal)
data
- The RDD of training rows.numTrees
- The number of trees that we want to create cache for.checkpointInterval
- The checkpointing interval
(how often should the cache be checkpointed.).initVal
- The initial values in the cache.public RDD<int[]> nodeIdsForInstances()
public int checkpointInterval()
public void updateNodeIndices(RDD<BaggedPoint<TreePoint>> data, scala.collection.mutable.Map<Object,NodeIndexUpdater>[] nodeIdUpdaters, Bin[][] bins)
data
- The RDD of training rows.nodeIdUpdaters
- A map of node index updaters.
The key is the indices of nodes that we want to update.bins
- Bin information needed to find child node indices.public void deleteAllCheckpoints()