📄 instances.html
字号:
<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"><TD><B>Methods inherited from class java.lang.Object</B></TD></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"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></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"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></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><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><HR><A NAME="Instances(java.io.Reader, int)"><!-- --></A><H3>Instances</H3><PRE>public <B>Instances</B>(java.io.Reader reader, int 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><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><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><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><DT><B>Parameters:</B><DD><CODE>capacity</CODE> - the capacity of the new dataset</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><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><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><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><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></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).<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> 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 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<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 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="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> instance)</PRE><DL><DD>Checks if the given instance is compatible with this dataset. Only looks at the size of the instance and the ranges of the values for nominal and string attributes.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the instance is compatible with the dataset</DL></DD></DL><HR><A NAME="classAttribute()"><!-- --></A><H3>classAttribute</H3><PRE>public <A HREF="../../weka/core/Attribute.html" title="class in weka.core">Attribute</A> <B>classAttribute</B>()</PRE><DL><DD>Returns the class attribute.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the class attribute<DT><B>Throws:</B><DD><CODE><A HREF="../../weka/core/UnassignedClassException.html" title="class in weka.core">UnassignedClassException</A></CODE> - if the class is not set</DL></DD></DL><HR><A NAME="classIndex()"><!-- --></A><H3>classIndex</H3><PRE>public int <B>classIndex</B>()</PRE><DL><DD>Returns the class attribute's index. Returns negative number if it's undefined.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the class index as an integer</DL></DD></DL><HR><A NAME="compactify()"><!-- --></A><H3>compactify</H3><PRE>public void <B>compactify</B>()</PRE><DL><DD>Compactifies the set of instances. Decreases the capacity of the set so that it matches the number of instances in the set.<P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="delete()"><!-- --></A><H3>delete</H3><PRE>public void <B>delete</B>()</PRE><DL><DD>Removes all instances from the set.<P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="delete(int)"><!-- --></A><H3>delete</H3><PRE>public void <B>delete</B>(int index)</PRE><DL><DD>Removes an instance at the given position from the set.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the instance's position</DL></DD></DL><HR><A NAME="deleteAttributeAt(int)"><!-- --></A><H3>deleteAttributeAt</H3>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -