public class TopDownConstructor extends BallTreeConstructor implements TechnicalInformationHandler
@techreport{Omohundro1989,
author = {Stephen M. Omohundro},
institution = {International Computer Science Institute},
month = {December},
number = {TR-89-063},
title = {Five Balltree Construction Algorithms},
year = {1989}
}
Valid options are:
-S <classname and options> Ball splitting algorithm to use.
| Modifier and Type | Field and Description |
|---|---|
protected BallSplitter |
m_Splitter
The BallSplitter algorithm used by the TopDown BallTree constructor, if it
is selected.
|
m_DistanceFunction, m_FullyContainChildBalls, m_Instances, m_InstList, m_MaxDepth, m_MaxInstancesInLeaf, m_MaxRelLeafRadius, m_NumLeaves, m_NumNodes| Constructor and Description |
|---|
TopDownConstructor()
Creates a new instance of TopDownConstructor.
|
| Modifier and Type | Method and Description |
|---|---|
int[] |
addInstance(BallNode node,
Instance inst)
Adds an instance to the ball tree.
|
java.lang.String |
ballSplitterTipText()
Returns the tip text for this property.
|
BallNode |
buildTree()
Builds the ball tree top down.
|
BallSplitter |
getBallSplitter()
Returns the BallSplitter algorithm set that would be used by the TopDown
BallTree constructor.
|
java.lang.String[] |
getOptions()
Gets the current settings of KDtree.
|
java.lang.String |
getRevision()
Returns the revision string.
|
TechnicalInformation |
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed
information about the technical background of this class, e.g., paper
reference or book this class is based on.
|
java.lang.String |
globalInfo()
Returns a string describing this nearest neighbour search algorithm.
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
protected void |
processNodesAfterAddInstance(BallNode node)
Post process method to correct the start and end indices of BallNodes on
the right of the node where the instance was added.
|
void |
setBallSplitter(BallSplitter splitter)
Sets the ball splitting algorithm to be used by the TopDown constructor.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options
|
protected void |
splitNodes(BallNode node,
int depth,
double rootRadius)
Recursively splits nodes of a ball tree until <=m_MaxInstancesInLeaf
instances remain in a node.
|
containChildBallsTipText, getContainChildBalls, getMaxDepth, getMaxInstancesInLeaf, getMaxRelativeLeafRadius, getNumLeaves, getNumNodes, maxInstancesInLeafTipText, maxRelativeLeafRadiusTipText, setContainChildBalls, setEuclideanDistanceFunction, setInstanceList, setInstances, setMaxInstancesInLeaf, setMaxRelativeLeafRadiusprotected BallSplitter m_Splitter
public TopDownConstructor()
public java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation in interface TechnicalInformationHandlerpublic BallNode buildTree() throws java.lang.Exception
buildTree in class BallTreeConstructorjava.lang.Exception - If there is problem building the tree.protected void splitNodes(BallNode node, int depth, double rootRadius) throws java.lang.Exception
node - The node to split.depth - The depth of this node in the tree, so that m_MaxDepth is
correctly updated.rootRadius - The smallest ball enclosing all the data points.java.lang.Exception - If there is some problem in splitting.public int[] addInstance(BallNode node, Instance inst) throws java.lang.Exception
addInstance in class BallTreeConstructornode - The root node of the tree.inst - The instance to add to the tree.java.lang.Exception - If there is some problem adding the given instance to the
tree.protected void processNodesAfterAddInstance(BallNode node)
node - The node whose m_Start and m_End need to be updated.public java.lang.String ballSplitterTipText()
public BallSplitter getBallSplitter()
public void setBallSplitter(BallSplitter splitter)
splitter - The BallSplitter to use.public java.util.Enumeration<Option> listOptions()
listOptions in interface OptionHandlerlistOptions in class BallTreeConstructorpublic void setOptions(java.lang.String[] options)
throws java.lang.Exception
-S <classname and options> Ball splitting algorithm to use.
setOptions in interface OptionHandlersetOptions in class BallTreeConstructoroptions - the list of options as an array of stringsjava.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlergetOptions in class BallTreeConstructorpublic java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class BallTreeConstructor