public class DTStatsAggregator
extends Object
implements scala.Serializable
Constructor and Description |
---|
DTStatsAggregator(DecisionTreeMetadata metadata,
scala.Option<int[]> featureSubset) |
Modifier and Type | Method and Description |
---|---|
void |
featureUpdate(int featureOffset,
int binIndex,
double label,
double instanceWeight)
Faster version of
update . |
int |
getFeatureOffset(int featureIndex)
Pre-compute feature offset for use with
featureUpdate . |
ImpurityCalculator |
getImpurityCalculator(int featureOffset,
int binIndex)
Get an
ImpurityCalculator for a given (node, feature, bin). |
scala.Tuple2<Object,Object> |
getLeftRightFeatureOffsets(int featureIndex)
Pre-compute feature offset for use with
featureUpdate . |
ImpurityAggregator |
impurityAggregator()
ImpurityAggregator instance specifying the impurity type. |
DTStatsAggregator |
merge(DTStatsAggregator other)
Merge this aggregator with another, and returns this aggregator.
|
void |
mergeForFeature(int featureOffset,
int binIndex,
int otherBinIndex)
For a given feature, merge the stats for two bins.
|
DecisionTreeMetadata |
metadata() |
void |
update(int featureIndex,
int binIndex,
double label,
double instanceWeight)
Update the stats for a given (feature, bin) for ordered features, using the given label.
|
public DTStatsAggregator(DecisionTreeMetadata metadata, scala.Option<int[]> featureSubset)
public DecisionTreeMetadata metadata()
public ImpurityAggregator impurityAggregator()
ImpurityAggregator
instance specifying the impurity type.public ImpurityCalculator getImpurityCalculator(int featureOffset, int binIndex)
ImpurityCalculator
for a given (node, feature, bin).featureOffset
- For ordered features, this is a pre-computed (node, feature) offset
from getFeatureOffset
.
For unordered features, this is a pre-computed
(node, feature, left/right child) offset from
getLeftRightFeatureOffsets
.public void update(int featureIndex, int binIndex, double label, double instanceWeight)
public void featureUpdate(int featureOffset, int binIndex, double label, double instanceWeight)
update
.
Update the stats for a given (feature, bin), using the given label.featureOffset
- For ordered features, this is a pre-computed feature offset
from getFeatureOffset
.
For unordered features, this is a pre-computed
(feature, left/right child) offset from
getLeftRightFeatureOffsets
.public int getFeatureOffset(int featureIndex)
featureUpdate
.
For ordered features only.public scala.Tuple2<Object,Object> getLeftRightFeatureOffsets(int featureIndex)
featureUpdate
.
For unordered features only.public void mergeForFeature(int featureOffset, int binIndex, int otherBinIndex)
featureOffset
- For ordered features, this is a pre-computed feature offset
from getFeatureOffset
.
For unordered features, this is a pre-computed
(feature, left/right child) offset from
getLeftRightFeatureOffsets
.binIndex
- The other bin is merged into this bin.otherBinIndex
- This bin is not modified.public DTStatsAggregator merge(DTStatsAggregator other)