📄 ibk.html
字号:
<A NAME="getKNN()"><!-- --></A><H3>getKNN</H3><PRE>public int <B>getKNN</B>()</PRE><DL><DD>Gets the number of neighbours the learner will use.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of neighbours.</DL></DD></DL><HR><A NAME="getWindowSize()"><!-- --></A><H3>getWindowSize</H3><PRE>public int <B>getWindowSize</B>()</PRE><DL><DD>Gets the maximum number of instances allowed in the training pool. The addition of new instances above this value will result in old instances being removed. A value of 0 signifies no limit to the number of training instances.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>Value of WindowSize.</DL></DD></DL><HR><A NAME="setWindowSize(int)"><!-- --></A><H3>setWindowSize</H3><PRE>public void <B>setWindowSize</B>(int newWindowSize)</PRE><DL><DD>Sets the maximum number of instances allowed in the training pool. The addition of new instances above this value will result in old instances being removed. A value of 0 signifies no limit to the number of training instances.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>newWindowSize</CODE> - Value to assign to WindowSize.</DL></DD></DL><HR><A NAME="getDistanceWeighting()"><!-- --></A><H3>getDistanceWeighting</H3><PRE>public <A HREF="../../weka/core/SelectedTag.html">SelectedTag</A> <B>getDistanceWeighting</B>()</PRE><DL><DD>Gets the distance weighting method used. Will be one of WEIGHT_NONE, WEIGHT_INVERSE, or WEIGHT_SIMILARITY<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the distance weighting method used.</DL></DD></DL><HR><A NAME="setDistanceWeighting(weka.core.SelectedTag)"><!-- --></A><H3>setDistanceWeighting</H3><PRE>public void <B>setDistanceWeighting</B>(<A HREF="../../weka/core/SelectedTag.html">SelectedTag</A> newMethod)</PRE><DL><DD>Sets the distance weighting method used. Values other than WEIGHT_NONE, WEIGHT_INVERSE, or WEIGHT_SIMILARITY will be ignored.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>newDistanceWeighting</CODE> - the distance weighting method to use</DL></DD></DL><HR><A NAME="getMeanSquared()"><!-- --></A><H3>getMeanSquared</H3><PRE>public boolean <B>getMeanSquared</B>()</PRE><DL><DD>Gets whether the mean squared error is used rather than mean absolute error when doing cross-validation.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if so.</DL></DD></DL><HR><A NAME="setMeanSquared(boolean)"><!-- --></A><H3>setMeanSquared</H3><PRE>public void <B>setMeanSquared</B>(boolean newMeanSquared)</PRE><DL><DD>Sets whether the mean squared error is used rather than mean absolute error when doing cross-validation.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>newMeanSquared</CODE> - true if so.</DL></DD></DL><HR><A NAME="getCrossValidate()"><!-- --></A><H3>getCrossValidate</H3><PRE>public boolean <B>getCrossValidate</B>()</PRE><DL><DD>Gets whether hold-one-out cross-validation will be used to select the best k value<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if cross-validation will be used.</DL></DD></DL><HR><A NAME="setCrossValidate(boolean)"><!-- --></A><H3>setCrossValidate</H3><PRE>public void <B>setCrossValidate</B>(boolean newCrossValidate)</PRE><DL><DD>Sets whether hold-one-out cross-validation will be used to select the best k value<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>newCrossValidate</CODE> - true if cross-validation should be used.</DL></DD></DL><HR><A NAME="getNumTraining()"><!-- --></A><H3>getNumTraining</H3><PRE>public int <B>getNumTraining</B>()</PRE><DL><DD>Get the number of training instances the classifier is currently using<DD><DL></DL></DD></DL><HR><A NAME="getAttributeMin(int)"><!-- --></A><H3>getAttributeMin</H3><PRE>public double <B>getAttributeMin</B>(int index) throws java.lang.Exception</PRE><DL><DD>Get an attributes minimum observed value<DD><DL></DL></DD></DL><HR><A NAME="getAttributeMax(int)"><!-- --></A><H3>getAttributeMax</H3><PRE>public double <B>getAttributeMax</B>(int index) throws java.lang.Exception</PRE><DL><DD>Get an attributes maximum observed value<DD><DL></DL></DD></DL><HR><A NAME="getNoNormalization()"><!-- --></A><H3>getNoNormalization</H3><PRE>public boolean <B>getNoNormalization</B>()</PRE><DL><DD>Gets whether normalization is turned off.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>Value of DontNormalize.</DL></DD></DL><HR><A NAME="setNoNormalization(boolean)"><!-- --></A><H3>setNoNormalization</H3><PRE>public void <B>setNoNormalization</B>(boolean v)</PRE><DL><DD>Set whether normalization is turned off.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>v</CODE> - Value to assign to DontNormalize.</DL></DD></DL><HR><A NAME="buildClassifier(weka.core.Instances)"><!-- --></A><H3>buildClassifier</H3><PRE>public void <B>buildClassifier</B>(<A HREF="../../weka/core/Instances.html">Instances</A> instances) throws java.lang.Exception</PRE><DL><DD>Generates the classifier.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../weka/classifiers/Classifier.html#buildClassifier(weka.core.Instances)">buildClassifier</A></CODE> in class <CODE><A HREF="../../weka/classifiers/Classifier.html">Classifier</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>instances</CODE> - set of instances serving as training data<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if the classifier has not been generated successfully</DL></DD></DL><HR><A NAME="updateClassifier(weka.core.Instance)"><!-- --></A><H3>updateClassifier</H3><PRE>public void <B>updateClassifier</B>(<A HREF="../../weka/core/Instance.html">Instance</A> instance) throws java.lang.Exception</PRE><DL><DD>Adds the supplied instance to the training set<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../weka/classifiers/UpdateableClassifier.html#updateClassifier(weka.core.Instance)">updateClassifier</A></CODE> in interface <CODE><A HREF="../../weka/classifiers/UpdateableClassifier.html">UpdateableClassifier</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>instance</CODE> - the instance to add<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if instance could not be incorporated successfully</DL></DD></DL><HR><A NAME="distributionForInstance(weka.core.Instance)"><!-- --></A><H3>distributionForInstance</H3><PRE>public double[] <B>distributionForInstance</B>(<A HREF="../../weka/core/Instance.html">Instance</A> instance) throws java.lang.Exception</PRE><DL><DD>Calculates the class membership probabilities for the given test instance.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../weka/classifiers/DistributionClassifier.html#distributionForInstance(weka.core.Instance)">distributionForInstance</A></CODE> in class <CODE><A HREF="../../weka/classifiers/DistributionClassifier.html">DistributionClassifier</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>instance</CODE> - the instance to be classified<DT><B>Returns:</B><DD>predicted class probability distribution<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if an error occurred during the prediction</DL></DD></DL><HR><A NAME="listOptions()"><!-- --></A><H3>listOptions</H3><PRE>public java.util.Enumeration <B>listOptions</B>()</PRE><DL><DD>Returns an enumeration describing the available options<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../weka/core/OptionHandler.html#listOptions()">listOptions</A></CODE> in interface <CODE><A HREF="../../weka/core/OptionHandler.html">OptionHandler</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>an enumeration of all the available options</DL></DD></DL><HR><A NAME="setOptions(java.lang.String[])"><!-- --></A><H3>setOptions</H3><PRE>public void <B>setOptions</B>(java.lang.String[] options) throws java.lang.Exception</PRE><DL><DD>Parses a given list of options. Valid options are:<p> -K num <br> Set the number of nearest neighbors to use in prediction (default 1) <p> -W num <br> Set a fixed window size for incremental train/testing. As new training instances are added, oldest instances are removed to maintain the number of training instances at this size. (default no window) <p> -D <br> Neighbors will be weighted by the inverse of their distance when voting. (default equal weighting) <p> -F <br> Neighbors will be weighted by their similarity when voting. (default equal weighting) <p> -X <br> Select the number of neighbors to use by hold-one-out cross validation, with an upper limit given by the -K option. <p> -S <br> When k is selected by cross-validation for numeric class attributes, minimize mean-squared error. (default mean absolute error) <p><DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../weka/core/OptionHandler.html#setOptions(java.lang.String[])">setOptions</A></CODE> in interface <CODE><A HREF="../../weka/core/OptionHandler.html">OptionHandler</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>options</CODE> - the list of options as an array of strings<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if an option is not supported</DL></DD></DL><HR><A NAME="getOptions()"><!-- --></A><H3>getOptions</H3><PRE>public java.lang.String[] <B>getOptions</B>()</PRE><DL><DD>Gets the current settings of IBk.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../weka/core/OptionHandler.html#getOptions()">getOptions</A></CODE> in interface <CODE><A HREF="../../weka/core/OptionHandler.html">OptionHandler</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>an array of strings suitable for passing to setOptions()</DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public java.lang.String <B>toString</B>()</PRE><DL><DD>Returns a description of this classifier.<DD><DL><DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a description of this classifier as a string.</DL></DD></DL><HR><A NAME="main(java.lang.String[])"><!-- --></A><H3>main</H3><PRE>public static void <B>main</B>(java.lang.String[] argv)</PRE><DL><DD>Main method for testing this class.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>argv</CODE> - should contain command line options (see setOptions)</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <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> </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/classifiers/IB1.html"><B>PREV CLASS</B></A> <A HREF="../../weka/classifiers/Id3.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="IBk.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -