类 BallTreeConstructor

java.lang.Object
weka.core.neighboursearch.balltrees.BallTreeConstructor
所有已实现的接口:
Serializable, OptionHandler, RevisionHandler
直接已知子类:
BottomUpConstructor, MiddleOutConstructor, TopDownConstructor

public abstract class BallTreeConstructor extends Object implements OptionHandler, Serializable, RevisionHandler
Abstract class for constructing a BallTree .
版本:
$Revision: 1.3 $
作者:
Ashraf M. Kibriya (amk14[at-the-rate]cs[dot]waikato[dot]ac[dot]nz)
另请参阅:
  • 构造器详细资料

    • BallTreeConstructor

      public BallTreeConstructor()
      Creates a new instance of BallTreeConstructor.
  • 方法详细资料

    • buildTree

      public abstract BallNode buildTree() throws Exception
      Builds the ball tree.
      返回:
      The root node of the tree.
      抛出:
      Exception - If there is problem building the tree.
    • addInstance

      public abstract int[] addInstance(BallNode node, Instance inst) throws Exception
      Adds an instance to the ball tree.
      参数:
      node - The root node of the tree.
      inst - The instance to add to the tree.
      返回:
      The new master index array after adding the instance.
      抛出:
      Exception - If there is some problem adding the given instance to the tree.
    • maxInstancesInLeafTipText

      public String maxInstancesInLeafTipText()
      Returns the tip text for this property.
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui.
    • getMaxInstancesInLeaf

      public int getMaxInstancesInLeaf()
      Returns the maximum number of instances allowed in a leaf.
      返回:
      The maximum number of instances allowed in a leaf.
    • setMaxInstancesInLeaf

      public void setMaxInstancesInLeaf(int num) throws Exception
      Sets the maximum number of instances allowed in a leaf.
      参数:
      num - The maximum number of instances allowed in a leaf.
      抛出:
      Exception - If the num is < 1.
    • maxRelativeLeafRadiusTipText

      public String maxRelativeLeafRadiusTipText()
      Returns the tip text for this property.
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui.
    • getMaxRelativeLeafRadius

      public double getMaxRelativeLeafRadius()
      Returns the maximum relative radius of a leaf node. It is relative to the radius of the smallest ball enclosing all the data points (that were used to build the tree). This smallest ball would be the same as the root node's ball, if ContainChildBalls property is set to false (default).
      返回:
      The maximum relative radius allowed for a leaf.
    • setMaxRelativeLeafRadius

      public void setMaxRelativeLeafRadius(double radius) throws Exception
      Sets the maximum relative radius, allowed for a leaf node. The radius is relative to the radius of the smallest ball enclosing all the data points (that were used to build the tree). This smallest ball would be the same as the root node's ball, if ContainChildBalls property is set to false (default).
      参数:
      radius - The maximum relative radius allowed for a leaf.
      抛出:
      Exception - If radius is < 0.0.
    • containChildBallsTipText

      public String containChildBallsTipText()
      Returns the tip text for this property.
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui.
    • getContainChildBalls

      public boolean getContainChildBalls()
      Gets whether if a parent ball should completely enclose its two child balls.
      返回:
      true if parent ball is to enclose its child balls.
    • setContainChildBalls

      public void setContainChildBalls(boolean containChildBalls)
      Sets whether if a parent ball should completely enclose its two child balls.
      参数:
      containChildBalls - Should be tree if parent ball is to enclose its child balls.
    • setInstances

      public void setInstances(Instances inst)
      Sets the instances on which the tree is to be built.
      参数:
      inst - The instances on which to build the ball tree.
    • setInstanceList

      public void setInstanceList(int[] instList)
      Sets the master index array that points to instances in m_Instances, so that only this array is manipulated, and m_Instances is left untouched.
      参数:
      instList - The master index array.
    • setEuclideanDistanceFunction

      public void setEuclideanDistanceFunction(EuclideanDistance func)
      Sets the distance function to use to build the tree.
      参数:
      func - The distance function.
    • getNumNodes

      public int getNumNodes()
      Returns the number of nodes (internal + leaf) in the built tree.
      返回:
      The number of nodes in the tree.
    • getNumLeaves

      public int getNumLeaves()
      Returns the number of leaves in the built tree.
      返回:
      The number of leaves in the tree.
    • getMaxDepth

      public int getMaxDepth()
      Returns the depth of the built tree.
      返回:
      The depth of the tree.
    • listOptions

      public Enumeration listOptions()
      Returns an enumeration describing the available options.
      指定者:
      listOptions 在接口中 OptionHandler
      返回:
      an enumeration of all the available options.
    • setOptions

      public void setOptions(String[] options) throws Exception
      Parses a given list of options.
      指定者:
      setOptions 在接口中 OptionHandler
      参数:
      options - the list of options as an array of strings
      抛出:
      Exception - if an option is not supported
    • getOptions

      public String[] getOptions()
      Gets the current settings.
      指定者:
      getOptions 在接口中 OptionHandler
      返回:
      an array of strings suitable for passing to setOptions
    • getRevision

      public String getRevision()
      Returns the revision string.
      指定者:
      getRevision 在接口中 RevisionHandler
      返回:
      the revision