org.ddogleg.nn.alg
Class AxisSplitterMedian<D>
- java.lang.Object
-
- org.ddogleg.nn.alg.AxisSplitterMedian<D>
-
- All Implemented Interfaces:
- AxisSplitter<D>
public class AxisSplitterMedian<D> extends java.lang.Object implements AxisSplitter<D>
Splits the points in K-D Tree node by selecting the axis with the largest variance. The point with the median value along that axis is the split point. The data is segmented into left and right lists using the sorted list used to find the median value.
-
-
Constructor Summary
Constructors Constructor and Description AxisSplitterMedian()Defaults to selecting the split axis with maximum varianceAxisSplitterMedian(AxisSplitRule splitRule)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetSplitAxis()The axis/dimension that the input list was split onDgetSplitData()Data associated with the split pointdouble[]getSplitPoint()Returns the point used to split the datavoidsetDimension(int N)voidsplitData(java.util.List<double[]> points, java.util.List<D> data, java.util.List<double[]> left, java.util.List<D> leftData, java.util.List<double[]> right, java.util.List<D> rightData)Given the a set of points, select the axis to split the data along and select a point to divide the data.
-
-
-
Constructor Detail
-
AxisSplitterMedian
public AxisSplitterMedian(AxisSplitRule splitRule)
-
AxisSplitterMedian
public AxisSplitterMedian()
Defaults to selecting the split axis with maximum variance
-
-
Method Detail
-
setDimension
public void setDimension(int N)
- Specified by:
setDimensionin interfaceAxisSplitter<D>
-
splitData
public void splitData(java.util.List<double[]> points, java.util.List<D> data, java.util.List<double[]> left, java.util.List<D> leftData, java.util.List<double[]> right, java.util.List<D> rightData)Description copied from interface:AxisSplitterGiven the a set of points, select the axis to split the data along and select a point to divide the data. Points whput items below the threshold into left and above into right. Data is optional and should be ignored if null. The selected- Specified by:
splitDatain interfaceAxisSplitter<D>- Parameters:
points- Input: Set of points.data- Input: (Optional) Set of data associated with the points. Can be null.left- Output: Storage for points less than the split point.leftData- Output: (Optional) Storage for data associated with left. Can be null.right- Output: Storage for points more than the split point.rightData- Output: (Optional) Storage for data associated with right. Can be null.
-
getSplitPoint
public double[] getSplitPoint()
Description copied from interface:AxisSplitterReturns the point used to split the data- Specified by:
getSplitPointin interfaceAxisSplitter<D>
-
getSplitData
public D getSplitData()
Description copied from interface:AxisSplitterData associated with the split point- Specified by:
getSplitDatain interfaceAxisSplitter<D>
-
getSplitAxis
public int getSplitAxis()
Description copied from interface:AxisSplitterThe axis/dimension that the input list was split on- Specified by:
getSplitAxisin interfaceAxisSplitter<D>- Returns:
-
-
DataMelt 3.0 © DataMelt by jWork.ORG