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.
|
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.
|
String[] |
getOptions()
Gets the current settings of KDtree.
|
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.
|
String |
globalInfo()
Returns a string describing this nearest neighbour search algorithm.
|
Enumeration |
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(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, setMaxRelativeLeafRadius
protected BallSplitter m_Splitter
public TopDownConstructor()
public String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public BallNode buildTree() throws Exception
buildTree
in class BallTreeConstructor
Exception
- If there is problem building
the tree.protected void splitNodes(BallNode node, int depth, double rootRadius) throws 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.Exception
- If there is some problem in
splitting.public int[] addInstance(BallNode node, Instance inst) throws Exception
addInstance
in class BallTreeConstructor
node
- The root node of the tree.inst
- The instance to add to the tree.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 String ballSplitterTipText()
public BallSplitter getBallSplitter()
public void setBallSplitter(BallSplitter splitter)
splitter
- The BallSplitter to use.public Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class BallTreeConstructor
public void setOptions(String[] options) throws Exception
-S <classname and options> Ball splitting algorithm to use.
setOptions
in interface OptionHandler
setOptions
in class BallTreeConstructor
options
- the list of options as an array of stringsException
- if an option is not supportedpublic String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class BallTreeConstructor
public String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class BallTreeConstructor
Copyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.