instances.html
来自「数据挖掘的最常用工具。由于开源」· HTML 代码 · 共 1,714 行 · 第 1/5 页
HTML
1,714 行
<TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#setClassIndex(int)">setClassIndex</A></B>(int classIndex)</CODE><BR> Sets the class index of the set.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#setRelationName(java.lang.String)">setRelationName</A></B>(java.lang.String newName)</CODE><BR> Sets the relation's name.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#sort(weka.core.Attribute)">sort</A></B>(<A HREF="../../weka/core/Attribute.html" title="class in weka.core">Attribute</A> att)</CODE><BR> Sorts the instances based on an attribute.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#sort(int)">sort</A></B>(int attIndex)</CODE><BR> Sorts the instances based on an attribute.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#stratify(int)">stratify</A></B>(int numFolds)</CODE><BR> Stratifies a set of instances according to its class values if the class attribute is nominal (so that afterwards a stratified cross-validation can be performed).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#stringFreeStructure()">stringFreeStructure</A></B>()</CODE><BR> Create a copy of the structure if the data has string or relational attributes, "cleanses" string types (i.e.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#sumOfWeights()">sumOfWeights</A></B>()</CODE><BR> Computes the sum of all the instances' weights.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#swap(int, int)">swap</A></B>(int i, int j)</CODE><BR> Swaps two instances in the set.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#test(java.lang.String[])">test</A></B>(java.lang.String[] argv)</CODE><BR> Method for testing this class.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#testCV(int, int)">testCV</A></B>(int numFolds, int numFold)</CODE><BR> Creates the test set for one fold of a cross-validation on the dataset.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#toString()">toString</A></B>()</CODE><BR> Returns the dataset as a string in ARFF format.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#toSummaryString()">toSummaryString</A></B>()</CODE><BR> Generates a string summarizing the set of instances.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#trainCV(int, int)">trainCV</A></B>(int numFolds, int numFold)</CODE><BR> Creates the training set for one fold of a cross-validation on the dataset.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#trainCV(int, int, java.util.Random)">trainCV</A></B>(int numFolds, int numFold, java.util.Random random)</CODE><BR> Creates the training set for one fold of a cross-validation on the dataset.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#undoRandomizeAttribute()">undoRandomizeAttribute</A></B>()</CODE><BR> Does an undo of a previous call to randomizeAttribute, so that the original values of the attribute are restored.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#variance(weka.core.Attribute)">variance</A></B>(<A HREF="../../weka/core/Attribute.html" title="class in weka.core">Attribute</A> att)</CODE><BR> Computes the variance for a numeric attribute.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#variance(int)">variance</A></B>(int attIndex)</CODE><BR> Computes the variance for a numeric attribute.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>equals, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Field Detail</B></FONT></TH></TR></TABLE><A NAME="FILE_EXTENSION"><!-- --></A><H3>FILE_EXTENSION</H3><PRE>public static final java.lang.String <B>FILE_EXTENSION</B></PRE><DL><DD>The filename extension that should be used for arff files<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#weka.core.Instances.FILE_EXTENSION">Constant Field Values</A></DL></DL><HR><A NAME="SERIALIZED_OBJ_FILE_EXTENSION"><!-- --></A><H3>SERIALIZED_OBJ_FILE_EXTENSION</H3><PRE>public static final java.lang.String <B>SERIALIZED_OBJ_FILE_EXTENSION</B></PRE><DL><DD>The filename extension that should be used for bin. serialized instances files<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#weka.core.Instances.SERIALIZED_OBJ_FILE_EXTENSION">Constant Field Values</A></DL></DL><HR><A NAME="ARFF_RELATION"><!-- --></A><H3>ARFF_RELATION</H3><PRE>public static final java.lang.String <B>ARFF_RELATION</B></PRE><DL><DD>The keyword used to denote the start of an arff header<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#weka.core.Instances.ARFF_RELATION">Constant Field Values</A></DL></DL><HR><A NAME="ARFF_DATA"><!-- --></A><H3>ARFF_DATA</H3><PRE>public static final java.lang.String <B>ARFF_DATA</B></PRE><DL><DD>The keyword used to denote the start of the arff data section<P><DL><DT><B>See Also:</B><DD><A HREF="../../constant-values.html#weka.core.Instances.ARFF_DATA">Constant Field Values</A></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="Instances(java.io.Reader)"><!-- --></A><H3>Instances</H3><PRE>public <B>Instances</B>(java.io.Reader reader) throws java.io.IOException</PRE><DL><DD>Reads an ARFF file from a reader, and assigns a weight of one to each instance. Lets the index of the class attribute be undefined (negative).<P><DL><DT><B>Parameters:</B><DD><CODE>reader</CODE> - the reader<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if the ARFF file is not read successfully</DL></DL><HR><A NAME="Instances(java.io.Reader, int)"><!-- --></A><H3>Instances</H3><PRE><FONT SIZE="-1">@Deprecated</FONT>public <B>Instances</B>(java.io.Reader reader, int capacity) throws java.io.IOException</PRE><DL><DD><B>Deprecated.</B> <I>instead of using this method in conjunction with the <code>readInstance(Reader)</code> method, one should use the <code>ArffLoader</code> or <code>DataSource</code> class instead.</I><P><DD>Reads the header of an ARFF file from a reader and reserves space for the given number of instances. Lets the class index be undefined (negative).<P><DL><DT><B>Parameters:</B><DD><CODE>reader</CODE> - the reader<DD><CODE>capacity</CODE> - the capacity<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the header is not read successfully or the capacity is negative.<DD><CODE>java.io.IOException</CODE> - if there is a problem with the reader.<DT><B>See Also:</B><DD><A HREF="../../weka/core/converters/ArffLoader.html" title="class in weka.core.converters"><CODE>ArffLoader</CODE></A>, <A HREF="../../weka/core/converters/ConverterUtils.DataSource.html" title="class in weka.core.converters"><CODE>ConverterUtils.DataSource</CODE></A></DL></DL><HR><A NAME="Instances(weka.core.Instances)"><!-- --></A><H3>Instances</H3><PRE>public <B>Instances</B>(<A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> dataset)</PRE><DL><DD>Constructor copying all instances and references to the header information from the given set of instances.<P><DL><DT><B>Parameters:</B><DD><CODE>dataset</CODE> - the set to be copied</DL></DL><HR><A NAME="Instances(weka.core.Instances, int)"><!-- --></A><H3>Instances</H3><PRE>public <B>Instances</B>(<A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> dataset, int capacity)</PRE><DL><DD>Constructor creating an empty set of instances. Copies references to the header information from the given set of instances. Sets the capacity of the set of instances to 0 if its negative.<P><DL><DT><B>Parameters:</B><DD><CODE>dataset</CODE> - the instances from which the header information is to be taken<DD><CODE>capacity</CODE> - the capacity of the new dataset</DL></DL><HR><A NAME="Instances(weka.core.Instances, int, int)"><!-- --></A><H3>Instances</H3><PRE>public <B>Instances</B>(<A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> source, int first, int toCopy)</PRE><DL><DD>Creates a new set of instances by copying a subset of another set.<P><DL><DT><B>Parameters:</B><DD><CODE>source</CODE> - the set of instances from which a subset is to be created<DD><CODE>first</CODE> - the index of the first instance to be copied<DD><CODE>toCopy</CODE> - the number of instances to be copied<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if first and toCopy are out of range</DL></DL><HR><A NAME="Instances(java.lang.String, weka.core.FastVector, int)"><!-- --></A><H3>Instances</H3><PRE>public <B>Instances</B>(java.lang.String name, <A HREF="../../weka/core/FastVector.html" title="class in weka.core">FastVector</A> attInfo, int capacity)</PRE><DL><DD>Creates an empty set of instances. Uses the given attribute information. Sets the capacity of the set of instances to 0 if its negative. Given attribute information must not be changed after this constructor has been used.<P><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the relation<DD><CODE>attInfo</CODE> - the attribute information<DD><CODE>capacity</CODE> - the capacity of the set</DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?