⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 instances.html

📁 weka是机器学习和数据挖掘领域最有影响力的开源项目之一
💻 HTML
📖 第 1 页 / 共 5 页
字号:
     int&nbsp;j)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#test(java.lang.String[])">test</A></B>(java.lang.String[]&nbsp;argv)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method for testing this class.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<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&nbsp;numFolds,       int&nbsp;numFold)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#toString()">toString</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#toSummaryString()">toSummaryString</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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&nbsp;numFolds,        int&nbsp;numFold)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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&nbsp;numFolds,        int&nbsp;numFold,        java.util.Random&nbsp;random)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;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>&nbsp;att)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;double</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instances.html#variance(int)">variance</A></B>(int&nbsp;attIndex)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Computes the variance for a numeric attribute.</TD></TR></TABLE>&nbsp;<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>&nbsp;<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 java.lang.String <B>FILE_EXTENSION</B></PRE><DL><DD>The filename extension that should be used for arff files<P><DL></DL></DL><HR><A NAME="SERIALIZED_OBJ_FILE_EXTENSION"><!-- --></A><H3>SERIALIZED_OBJ_FILE_EXTENSION</H3><PRE>public static 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></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&nbsp;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>public <B>Instances</B>(java.io.Reader&nbsp;reader,                 int&nbsp;capacity)          throws java.io.IOException</PRE><DL><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.</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>&nbsp;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>&nbsp;dataset,                 int&nbsp;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>&nbsp;source,                 int&nbsp;first,                 int&nbsp;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&nbsp;name,                 <A HREF="../../weka/core/FastVector.html" title="class in weka.core">FastVector</A>&nbsp;attInfo,                 int&nbsp;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></TABLE><A NAME="stringFreeStructure()"><!-- --></A><H3>stringFreeStructure</H3><PRE>public <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> <B>stringFreeStructure</B>()</PRE><DL><DD>Create a copy of the structure, but "cleanse" string types (i.e. doesn't contain references to the strings seen in the past). Also cleanses all relational attributes.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a copy of the instance structure.</DL></DD></DL><HR><A NAME="add(weka.core.Instance)"><!-- --></A><H3>add</H3><PRE>public void <B>add</B>(<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A>&nbsp;instance)</PRE><DL><DD>Adds one instance to the end of the set.  Shallow copies instance before it is added. Increases the size of the dataset if it is not large enough. Does not check if the instance is compatible with the dataset.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>instance</CODE> - the instance to be added</DL></DD></DL><HR><A NAME="attribute(int)"><!-- --></A><H3>attribute</H3><PRE>public <A HREF="../../weka/core/Attribute.html" title="class in weka.core">Attribute</A> <B>attribute</B>(int&nbsp;index)</PRE><DL><DD>Returns an attribute.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the attribute's index (index starts with 0)<DT><B>Returns:</B><DD>the attribute at the given position</DL></DD></DL><HR><A NAME="attribute(java.lang.String)"><!-- --></A><H3>attribute</H3><PRE>public <A HREF="../../weka/core/Attribute.html" title="class in weka.core">Attribute</A> <B>attribute</B>(java.lang.String&nbsp;name)</PRE><DL><DD>Returns an attribute given its name. If there is more than one attribute with the same name, it returns the first one. Returns null if the attribute can't be found.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the attribute's name<DT><B>Returns:</B><DD>the attribute with the given name, null if the attribute can't be found</DL></DD></DL><HR><A NAME="checkForAttributeType(int)"><!-- --></A><H3>checkForAttributeType</H3><PRE>public boolean <B>checkForAttributeType</B>(int&nbsp;attType)</PRE><DL><DD>Checks for attributes of the given type in the dataset<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>attType</CODE> - the attribute type to look for<DT><B>Returns:</B><DD>true if attributes of the given type are present</DL></DD></DL><HR><A NAME="checkForStringAttributes()"><!-- --></A><H3>checkForStringAttributes</H3><PRE>public boolean <B>checkForStringAttributes</B>()</PRE><DL><DD>Checks for string attributes in the dataset<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if string attributes are present, false otherwise</DL></DD></DL><HR><A NAME="checkInstance(weka.core.Instance)"><!-- --></A><H3>checkInstance</H3><PRE>public boolean <B>checkInstance</B>(<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A>&nbsp;instance)</PRE>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -