linearnnsearch.html
来自「数据挖掘的最常用工具。由于开源」· HTML 代码 · 共 678 行 · 第 1/3 页
HTML
678 行
<PRE>public boolean <B>getSkipIdentical</B>()</PRE><DL><DD>Gets whether if identical instances are skipped from the neighbourhood.<P><DD><DL><DT><B>Returns:</B><DD>true if identical instances are skipped</DL></DD></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 instance in the current neighbourhood to the supplied 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 instance<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if the nearest neighbour could not be found.</DL></DD></DL><HR><A NAME="kNearestNeighbours(weka.core.Instance, int)"><!-- --></A><H3>kNearestNeighbours</H3><PRE>public <A HREF="../../../weka/core/Instances.html" title="class in weka.core">Instances</A> <B>kNearestNeighbours</B>(<A HREF="../../../weka/core/Instance.html" title="class in weka.core">Instance</A> target, int kNN) throws java.lang.Exception</PRE><DL><DD>Returns k nearest instances in the current neighbourhood to the supplied instance.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../weka/core/neighboursearch/NearestNeighbourSearch.html#kNearestNeighbours(weka.core.Instance, int)">kNearestNeighbours</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 k nearest neighbours for.<DD><CODE>kNN</CODE> - The number of nearest neighbours to find.<DT><B>Returns:</B><DD>the k nearest neighbors<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 of the k nearest neighbours. The kNearestNeighbours or nearestNeighbour must always be called before calling this function. If this function is called before calling either the kNearestNeighbours or the nearestNeighbour, then it throws an exception. If, however, if either of the nearestNeighbour functions are called at any point in the past then no exception is thrown and the distances of the training set from the last supplied target instance (to either one of the nearestNeighbour functions) is/are returned.<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> insts) throws java.lang.Exception</PRE><DL><DD>Sets the instances comprising the current neighbourhood.<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>insts</CODE> - The set of instances on which the nearest neighbour search is carried out. Usually this set is the training set.<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if setting of instances fails</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> ins) throws java.lang.Exception</PRE><DL><DD>Updates the LinearNNSearch to cater for the new added instance. This implementation only updates the ranges of the DistanceFunction class, since our set of instances is passed by reference and should already have the newly added 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>ins</CODE> - The instance to add. Usually this is the instance that is added to our neighbourhood i.e. the training instances.<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if the given instances are null</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> ins)</PRE><DL><DD>Adds the given instance info. This implementation updates the range datastructures of the DistanceFunction class.<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>ins</CODE> - The instance to add the information of. Usually this is the test instance supplied to update the range of attributes in the distance function.</DL></DD></DL><HR><A NAME="getRevision()"><!-- --></A><H3>getRevision</H3><PRE>public java.lang.String <B>getRevision</B>()</PRE><DL><DD>Returns the revision string.<P><DD><DL><DT><B>Returns:</B><DD>the revision</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="http://www.cs.waikato.ac.nz/ml/weka/" target="_blank"><FONT CLASS="NavBarFont1"><B>Weka's home</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../weka/core/neighboursearch/KDTree.html" title="class in weka.core.neighboursearch"><B>PREV CLASS</B></A> <A HREF="../../../weka/core/neighboursearch/NearestNeighbourSearch.html" title="class in weka.core.neighboursearch"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?weka/core/neighboursearch/LinearNNSearch.html" target="_top"><B>FRAMES</B></A> <A HREF="LinearNNSearch.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?