kdtree.html
来自「数据挖掘的最常用工具。由于开源」· HTML 代码 · 共 1,345 行 · 第 1/4 页
HTML
1,345 行
</DL><HR><A NAME="nearestNeighbour(weka.core.Instance)"><!-- --></A><H3>nearestNeighbour</H3><PRE>public <A HREF="../../../weka/core/Instance.html" title="class in weka.core">Instance</A> <B>nearestNeighbour</B>(<A HREF="../../../weka/core/Instance.html" title="class in weka.core">Instance</A> target) throws java.lang.Exception</PRE><DL><DD>Returns the nearest neighbour of the supplied target instance.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../weka/core/neighboursearch/NearestNeighbourSearch.html#nearestNeighbour(weka.core.Instance)">nearestNeighbour</A></CODE> in class <CODE><A HREF="../../../weka/core/neighboursearch/NearestNeighbourSearch.html" title="class in weka.core.neighboursearch">NearestNeighbourSearch</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>target</CODE> - The instance to find the nearest neighbour for.<DT><B>Returns:</B><DD>The nearest neighbour from among the previously supplied training instances.<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if the neighbours could not be found.</DL></DD></DL><HR><A NAME="getDistances()"><!-- --></A><H3>getDistances</H3><PRE>public double[] <B>getDistances</B>() throws java.lang.Exception</PRE><DL><DD>Returns the distances to the kNearest or 1 nearest neighbour currently found with either the kNearestNeighbours or the nearestNeighbour method.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../weka/core/neighboursearch/NearestNeighbourSearch.html#getDistances()">getDistances</A></CODE> in class <CODE><A HREF="../../../weka/core/neighboursearch/NearestNeighbourSearch.html" title="class in weka.core.neighboursearch">NearestNeighbourSearch</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>array containing the distances of the nearestNeighbours. The length and ordering of the array is the same as that of the instances returned by nearestNeighbour functions.<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if called before calling kNearestNeighbours or nearestNeighbours.</DL></DD></DL><HR><A NAME="setInstances(weka.core.Instances)"><!-- --></A><H3>setInstances</H3><PRE>public void <B>setInstances</B>(<A HREF="../../../weka/core/Instances.html" title="class in weka.core">Instances</A> instances) throws java.lang.Exception</PRE><DL><DD>Builds the KDTree on the given set of instances.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../weka/core/neighboursearch/NearestNeighbourSearch.html#setInstances(weka.core.Instances)">setInstances</A></CODE> in class <CODE><A HREF="../../../weka/core/neighboursearch/NearestNeighbourSearch.html" title="class in weka.core.neighboursearch">NearestNeighbourSearch</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>instances</CODE> - The insts on which the KDTree is to be built.<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - If some error occurs while building the KDTree</DL></DD></DL><HR><A NAME="update(weka.core.Instance)"><!-- --></A><H3>update</H3><PRE>public void <B>update</B>(<A HREF="../../../weka/core/Instance.html" title="class in weka.core">Instance</A> instance) throws java.lang.Exception</PRE><DL><DD>Adds one instance to the KDTree. This updates the KDTree structure to take into account the newly added training instance.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../weka/core/neighboursearch/NearestNeighbourSearch.html#update(weka.core.Instance)">update</A></CODE> in class <CODE><A HREF="../../../weka/core/neighboursearch/NearestNeighbourSearch.html" title="class in weka.core.neighboursearch">NearestNeighbourSearch</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>instance</CODE> - the instance to be added. Usually the newly added instance in the training set.<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - If the instance cannot be added.</DL></DD></DL><HR><A NAME="addInstanceInfo(weka.core.Instance)"><!-- --></A><H3>addInstanceInfo</H3><PRE>public void <B>addInstanceInfo</B>(<A HREF="../../../weka/core/Instance.html" title="class in weka.core">Instance</A> instance)</PRE><DL><DD>Adds one instance to KDTree loosly. It only changes the ranges in EuclideanDistance, and does not affect the structure of the KDTree.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../weka/core/neighboursearch/NearestNeighbourSearch.html#addInstanceInfo(weka.core.Instance)">addInstanceInfo</A></CODE> in class <CODE><A HREF="../../../weka/core/neighboursearch/NearestNeighbourSearch.html" title="class in weka.core.neighboursearch">NearestNeighbourSearch</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>instance</CODE> - the new instance. Usually this is the test instance supplied to update the range of attributes in the distance function.</DL></DD></DL><HR><A NAME="measureTreeSize()"><!-- --></A><H3>measureTreeSize</H3><PRE>public double <B>measureTreeSize</B>()</PRE><DL><DD>Returns the size of the tree.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the size of the tree</DL></DD></DL><HR><A NAME="measureNumLeaves()"><!-- --></A><H3>measureNumLeaves</H3><PRE>public double <B>measureNumLeaves</B>()</PRE><DL><DD>Returns the number of leaves.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of leaves</DL></DD></DL><HR><A NAME="measureMaxDepth()"><!-- --></A><H3>measureMaxDepth</H3><PRE>public double <B>measureMaxDepth</B>()</PRE><DL><DD>Returns the depth of the tree.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>The depth of the tree</DL></DD></DL><HR><A NAME="enumerateMeasures()"><!-- --></A><H3>enumerateMeasures</H3><PRE>public java.util.Enumeration <B>enumerateMeasures</B>()</PRE><DL><DD>Returns an enumeration of the additional measure names.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../weka/core/AdditionalMeasureProducer.html#enumerateMeasures()">enumerateMeasures</A></CODE> in interface <CODE><A HREF="../../../weka/core/AdditionalMeasureProducer.html" title="interface in weka.core">AdditionalMeasureProducer</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../../weka/core/neighboursearch/NearestNeighbourSearch.html#enumerateMeasures()">enumerateMeasures</A></CODE> in class <CODE><A HREF="../../../weka/core/neighboursearch/NearestNeighbourSearch.html" title="class in weka.core.neighboursearch">NearestNeighbourSearch</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>an enumeration of the measure names</DL></DD></DL><HR><A NAME="getMeasure(java.lang.String)"><!-- --></A><H3>getMeasure</H3><PRE>public double <B>getMeasure</B>(java.lang.String additionalMeasureName)</PRE><DL><DD>Returns the value of the named measure.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../weka/core/AdditionalMeasureProducer.html#getMeasure(java.lang.String)">getMeasure</A></CODE> in interface <CODE><A HREF="../../../weka/core/AdditionalMeasureProducer.html" title="interface in weka.core">AdditionalMeasureProducer</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../../weka/core/neighboursearch/NearestNeighbourSearch.html#getMeasure(java.lang.String)">getMeasure</A></CODE> in class <CODE><A HREF="../../../weka/core/neighboursearch/NearestNeighbourSearch.html" title="class in weka.core.neighboursearch">NearestNeighbourSearch</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>additionalMeasureName</CODE> - the name of the measure to query for its value.<DT><B>Returns:</B><DD>The value of the named measure<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - If the named measure is not supported.</DL></DD></DL><HR><A NAME="setMeasurePerformance(boolean)"><!-- --></A><H3>setMeasurePerformance</H3><PRE>public void <B>setMeasurePerformance</B>(boolean measurePerformance)</PRE><DL><DD>Sets whether to calculate the performance statistics or not.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../weka/core/neighboursearch/NearestNeighbourSearch.html#setMeasurePerformance(boolean)">setMeasurePerformance</A></CODE> in class <CODE><A HREF="../../../weka/core/neighboursearch/NearestNeighbourSearch.html" title="class in weka.core.neighboursearch">NearestNeighbourSearch</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>measurePerformance</CODE> - Should be true if performance statistics are to be measured.</DL></DD></DL><HR><A NAME="centerInstances(weka.core.Instances, int[], double)"><!-- --></A><H3>centerInstances</H3><PRE>public void <B>centerInstances</B>(<A HREF="../../../weka/core/Instances.html" title="class in weka.core">Instances</A> centers, int[] assignments, double pc) throws java.lang.Exception</PRE><DL><DD>Assigns instances to centers using KDTree.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>centers</CODE> - the current centers<DD><CODE>assignments</CODE> - the centerindex for each instance<DD><CODE>pc</CODE> - the threshold value for pruning.<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - If there is some problem assigning instances to centers.</DL></DD></DL><HR><A NAME="assignSubToCenters(weka.core.neighboursearch.kdtrees.KDTreeNode, weka.core.Instances, int[], int[])"><!-- --></A><H3>assignSubToCenters</H3><PRE>public void <B>assignSubToCenters</B>(<A HREF="../../../weka/core/neighboursearch/kdtrees/KDTreeNode.html" title="class in weka.core.neighboursearch.kdtrees">KDTreeNode</A> node, <A HREF="../../../weka/core/Instances.html" title="class in weka.core">Instances</A> centers, int[] centList, int[] assignments) throws java.lang.Exception</PRE><DL><DD>Assigns instances of this node to center. Center to be assign to is decided by the distance function.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>node</CODE> - The KDTreeNode whose instances are to be assigned.<DD><CODE>centers</CODE> - all the input centers<DD><CODE>centList</CODE> - the list of centers to work with<DD><CODE>assignments</CODE> - index list of last assignments<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - If there is error assigning the instances.</DL></DD></DL><HR><A NAME="minBoxRelWidthTipText()"><!-- --></A><H3>minBoxRelWidthTipText</H3><PRE>public java.lang.String <B>minBoxRelWidthTipText</B>()</PRE><DL><DD>Tip text for this property.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the tip text for this property</DL></DD></DL><HR><A NAME="setMinBoxRelWidth(double)"><!-- --></A><H3>setMinBoxRelWidth</H3><PRE>public void <B>setMinBoxRelWidth</B>(double i)</PRE><DL><DD>Sets the minimum relative box width.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>i</CODE> - the minimum relative box width</DL></DD></DL><HR><A NAME="getMinBoxRelWidth()"><!-- --></A><H3>getMinBoxRelWidth</H3><PRE>public double <B>getMinBoxRelWidth</B>()</PRE><DL><DD>Gets the minimum relative box width.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the minimum relative box width</DL></DD></DL><HR><A NAME="maxInstInLeafTipText()"><!-- --></A><H3>maxInstInLeafTipText</H3><PRE>public java.lang.String <B>maxInstInLeafTipText</B>()</PRE><DL><DD>Tip text for this property.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the tip text for this property</DL></DD></DL><HR><A NAME="setMaxInstInLeaf(int)"><!-- --></A><H3>setMaxInstInLeaf</H3><PRE>public void <B>setMaxInstInLeaf</B>(int i)</PRE><DL><DD>Sets the maximum number of instances in a leaf.<P><DD><DL></DL>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?