instances.html

来自「数据挖掘的最常用工具。由于开源」· HTML 代码 · 共 1,714 行 · 第 1/5 页

HTML
1,714
字号
</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 if the data has string or relational attributes, "cleanses" string types (i.e. doesn't contain references to the strings seen in the past) and 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. Note: String or relational values are not transferred.<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><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>Parameters:</B><DD><CODE>instance</CODE> - the instance to check<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&nbsp;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 (index starts with 0)</DL></DD></DL><HR><A NAME="deleteAttributeAt(int)"><!-- --></A><H3>deleteAttributeAt</H3><PRE>public void <B>deleteAttributeAt</B>(int&nbsp;position)</PRE><DL><DD>Deletes an attribute at the given position  (0 to numAttributes() - 1). A deep copy of the attribute information is performed before the attribute is deleted.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>position</CODE> - the attribute's position (position starts with 0)<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the given index is out of range             or the class attribute is being deleted</DL></DD></DL><HR><A NAME="deleteAttributeType(int)"><!-- --></A><H3>deleteAttributeType</H3><PRE>public void <B>deleteAttributeType</B>(int&nbsp;attType)</PRE><DL><DD>Deletes all attributes of the given type in the dataset. A deep copy of  the attribute information is performed before an attribute is deleted.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>attType</CODE> - the attribute type to delete<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if attribute couldn't be  successfully deleted (probably because it is the class attribute).</DL></DD></DL><HR><A NAME="deleteStringAttributes()"><!-- --></A><H3>deleteStringAttributes</H3><PRE>public void <B>deleteStringAttributes</B>()</PRE><DL><DD>Deletes all string attributes in the dataset. A deep copy of the attribute information is performed before an attribute is deleted.<P><DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if string attribute couldn't be  successfully deleted (probably because it is the class attribute).<DT><B>See Also:</B><DD><A HREF="../../weka/core/Instances.html#deleteAttributeType(int)"><CODE>deleteAttributeType(int)</CODE></A></DL></DD></DL><HR><A NAME="deleteWithMissing(int)"><!-- --></A><H3>deleteWithMissing</H3><PRE>public void <B>deleteWithMissing</B>(int&nbsp;attIndex)</PRE><DL><DD>Removes all instances with missing values for a particular attribute from the dataset.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>attIndex</CODE> - the attribute's index (index starts with 0)</DL></DD></DL><HR><A NAME="deleteWithMissing(weka.core.Attribute)"><!-- --></A><H3>deleteWithMissing</H3><PRE>public void <B>deleteWithMissing</B>(<A HREF="../../weka/core/Attribute.html" title="class in weka.core">Attribute</A>&nbsp;att)</PRE><DL><DD>Removes all instances with missing values for a particular attribute from the dataset.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>att</CODE> - the attribute</DL></DD></DL><HR><A NAME="deleteWithMissingClass()"><!-- --></A><H3>deleteWithMissingClass</H3><PRE>public void <B>deleteWithMissingClass</B>()</PRE><DL><DD>Removes all instances with a missing class value from the dataset.<P><DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../weka/core/UnassignedClassException.html" title="class in weka.core">UnassignedClassException</A></CODE> - if class is not set</DL></DD></DL><HR><A NAME="enumerateAttributes()"><!-- --></A><H3>enumerateAttributes</H3><PRE>public java.util.Enumeration <B>enumerateAttributes</B>()</PRE><DL><DD>Returns an enumeration of all the attributes.<P><DD><DL></DL></DD>

⌨️ 快捷键说明

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