public class MedianOfWidestDimension extends BallSplitter implements OptionHandler, 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:
-N Normalize dimensions' widths.
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
m_NormalizeDimWidths
Should we normalize the widths(ranges) of the dimensions (attributes)
before selecting the widest one.
|
m_DistanceFunction, m_Instances, m_Instlist| Constructor and Description |
|---|
MedianOfWidestDimension()
Constructor.
|
MedianOfWidestDimension(int[] instList,
Instances insts,
EuclideanDistance e)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getNormalizeDimWidths()
Whether we are normalizing the widths(ranges) of the dimensions
(attributes) or not.
|
java.lang.String[] |
getOptions()
Gets the current settings.
|
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.
|
java.lang.String |
normalizeDimWidthsTipText()
Returns the tip text for this property.
|
protected int |
partition(int attIdx,
int[] index,
int l,
int r)
Partitions the instances around a pivot.
|
int |
select(int attIdx,
int[] indices,
int left,
int right,
int k)
Implements computation of the kth-smallest element according to Manber's
"Introduction to Algorithms".
|
void |
setNormalizeDimWidths(boolean normalize)
Should we normalize the widths(ranges) of the dimensions (attributes)
before selecting the widest one.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options
|
void |
splitNode(BallNode node,
int numNodesCreated)
Splits a ball into two.
|
protected int |
widestDim(double[][] nodeRanges,
double[][] universe)
Returns the widest dimension.
|
correctlyInitialized, setEuclideanDistanceFunction, setInstanceList, setInstancesprotected boolean m_NormalizeDimWidths
public MedianOfWidestDimension()
public MedianOfWidestDimension(int[] instList,
Instances insts,
EuclideanDistance e)
instList - The master index array.insts - The instances on which the tree is (or is to be) built.e - The Euclidean distance function to use for splitting.public java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation in interface TechnicalInformationHandlerpublic void splitNode(BallNode node, int numNodesCreated) throws java.lang.Exception
splitNode in class BallSplitternode - The node to split.numNodesCreated - The number of nodes that so far have been created
for the tree, so that the newly created nodes are assigned
correct/meaningful node numbers/ids.java.lang.Exception - If there is some problem in splitting the given node.protected int partition(int attIdx,
int[] index,
int l,
int r)
attIdx - The attribution/dimension based on which the instances should
be partitioned.index - The master index array containing indices of the instances.l - The begining index of the portion of master index array that
should be partitioned.r - The end index of the portion of master index array that should be
partitioned.public int select(int attIdx,
int[] indices,
int left,
int right,
int k)
attIdx - The dimension/attribute of the instances in which to find the
kth-smallest element.indices - The master index array containing indices of the instances.left - The begining index of the portion of the master index array in
which to find the kth-smallest element.right - The end index of the portion of the master index array in
which to find the kth-smallest element.k - The value of kprotected int widestDim(double[][] nodeRanges,
double[][] universe)
nodeRanges - The attributes' range of the points inside the node that
is to be split.universe - The attributes' range for the whole point-space.public java.lang.String normalizeDimWidthsTipText()
public void setNormalizeDimWidths(boolean normalize)
normalize - Should be true if the widths are to be normalized.public boolean getNormalizeDimWidths()
public java.util.Enumeration<Option> listOptions()
listOptions in interface OptionHandlerlistOptions in class BallSplitterpublic void setOptions(java.lang.String[] options)
throws java.lang.Exception
-N Normalize dimensions' widths.
setOptions in interface OptionHandlersetOptions in class BallSplitteroptions - 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 BallSplitterpublic java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class BallSplitter