类 BallTreeConstructor
java.lang.Object
weka.core.neighboursearch.balltrees.BallTreeConstructor
- 所有已实现的接口:
Serializable
,OptionHandler
,RevisionHandler
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)
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明abstract int[]
addInstance
(BallNode node, Instance inst) Adds an instance to the ball tree.abstract BallNode
Builds the ball tree.Returns the tip text for this property.boolean
Gets whether if a parent ball should completely enclose its two child balls.int
Returns the depth of the built tree.int
Returns the maximum number of instances allowed in a leaf.double
Returns the maximum relative radius of a leaf node.int
Returns the number of leaves in the built tree.int
Returns the number of nodes (internal + leaf) in the built tree.String[]
Gets the current settings.Returns the revision string.Returns an enumeration describing the available options.Returns the tip text for this property.Returns the tip text for this property.void
setContainChildBalls
(boolean containChildBalls) Sets whether if a parent ball should completely enclose its two child balls.void
Sets the distance function to use to build the tree.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.void
setInstances
(Instances inst) Sets the instances on which the tree is to be built.void
setMaxInstancesInLeaf
(int num) Sets the maximum number of instances allowed in a leaf.void
setMaxRelativeLeafRadius
(double radius) Sets the maximum relative radius, allowed for a leaf node.void
setOptions
(String[] options) Parses a given list of options.
-
构造器详细资料
-
BallTreeConstructor
public BallTreeConstructor()Creates a new instance of BallTreeConstructor.
-
-
方法详细资料
-
buildTree
Builds the ball tree.- 返回:
- The root node of the tree.
- 抛出:
Exception
- If there is problem building the tree.
-
addInstance
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
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
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
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
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
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
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
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
Returns an enumeration describing the available options.- 指定者:
listOptions
在接口中OptionHandler
- 返回:
- an enumeration of all the available options.
-
setOptions
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
Gets the current settings.- 指定者:
getOptions
在接口中OptionHandler
- 返回:
- an array of strings suitable for passing to setOptions
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 返回:
- the revision
-