T
- Type of impurity measure.public abstract class ImpurityMeasureCalculator<T extends ImpurityMeasure<T>> extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected boolean |
useIdx
Use index structure instead of using sorting while learning.
|
Constructor and Description |
---|
ImpurityMeasureCalculator(boolean useIdx)
Constructs an instance of ImpurityMeasureCalculator.
|
Modifier and Type | Method and Description |
---|---|
abstract StepFunction<T>[] |
calculate(DecisionTreeData data,
TreeFilter filter,
int depth)
Calculates all impurity measures required required to find a best split and returns them as an array of
StepFunction (for every column). |
protected int |
columnsCount(DecisionTreeData data,
TreeDataIndex idx)
Returns columns count in current dataset.
|
protected double |
getFeatureValue(DecisionTreeData data,
TreeDataIndex idx,
int featureId,
int k)
Returns feature value in according to kth order statistic.
|
protected Vector |
getFeatureValues(DecisionTreeData data,
TreeDataIndex idx,
int featureId,
int k)
Returns feature value in according to kth order statistic.
|
protected double |
getLabelValue(DecisionTreeData data,
TreeDataIndex idx,
int featureId,
int k)
Returns label value in according to kth order statistic.
|
protected int |
rowsCount(DecisionTreeData data,
TreeDataIndex idx)
Returns rows count in current dataset.
|
protected final boolean useIdx
public ImpurityMeasureCalculator(boolean useIdx)
useIdx
- Use index.public abstract StepFunction<T>[] calculate(DecisionTreeData data, TreeFilter filter, int depth)
StepFunction
(for every column).data
- Features and labels.StepFunction
(for every column).protected int columnsCount(DecisionTreeData data, TreeDataIndex idx)
data
- Data.idx
- Index.protected int rowsCount(DecisionTreeData data, TreeDataIndex idx)
data
- Data.idx
- Index.protected double getLabelValue(DecisionTreeData data, TreeDataIndex idx, int featureId, int k)
data
- Data.idx
- Index.featureId
- Feature id.k
- K-th statistic.protected double getFeatureValue(DecisionTreeData data, TreeDataIndex idx, int featureId, int k)
data
- Data.idx
- Index.featureId
- Feature id.k
- K-th statistic.protected Vector getFeatureValues(DecisionTreeData data, TreeDataIndex idx, int featureId, int k)
data
- Data.idx
- Index.featureId
- Feature id.k
- K-th statistic.
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024