📄 instances.html
字号:
<PRE>public void <B>deleteAttributeAt</B>(int 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>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="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).</DL></DD></DL><HR><A NAME="deleteWithMissing(int)"><!-- --></A><H3>deleteWithMissing</H3><PRE>public void <B>deleteWithMissing</B>(int 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</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> 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><DD><DL><DT><B>Returns:</B><DD>enumeration of all the attributes.</DL></DD></DL><HR><A NAME="enumerateInstances()"><!-- --></A><H3>enumerateInstances</H3><PRE>public java.util.Enumeration <B>enumerateInstances</B>()</PRE><DL><DD>Returns an enumeration of all instances in the dataset.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>enumeration of all instances in the dataset</DL></DD></DL><HR><A NAME="equalHeaders(weka.core.Instances)"><!-- --></A><H3>equalHeaders</H3><PRE>public boolean <B>equalHeaders</B>(<A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> dataset)</PRE><DL><DD>Checks if two headers are equivalent.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>dataset</CODE> - another dataset<DT><B>Returns:</B><DD>true if the header of the given dataset is equivalent to this header</DL></DD></DL><HR><A NAME="firstInstance()"><!-- --></A><H3>firstInstance</H3><PRE>public <A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> <B>firstInstance</B>()</PRE><DL><DD>Returns the first instance in the set.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the first instance in the set</DL></DD></DL><HR><A NAME="getRandomNumberGenerator(long)"><!-- --></A><H3>getRandomNumberGenerator</H3><PRE>public java.util.Random <B>getRandomNumberGenerator</B>(long seed)</PRE><DL><DD>Returns a random number generator. The initial seed of the random number generator depends on the given seed and the hash code of a string representation of a instances chosen based on the given seed.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>seed</CODE> - the given seed<DT><B>Returns:</B><DD>the random number generator</DL></DD></DL><HR><A NAME="insertAttributeAt(weka.core.Attribute, int)"><!-- --></A><H3>insertAttributeAt</H3><PRE>public void <B>insertAttributeAt</B>(<A HREF="../../weka/core/Attribute.html" title="class in weka.core">Attribute</A> att, int position)</PRE><DL><DD>Inserts an attribute at the given position (0 to numAttributes()) and sets all values to be missing. Shallow copies the attribute before it is inserted, and performs a deep copy of the existing attribute information.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>att</CODE> - the attribute to be inserted<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the given index is out of range</DL></DD></DL><HR><A NAME="instance(int)"><!-- --></A><H3>instance</H3><PRE>public <A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> <B>instance</B>(int index)</PRE><DL><DD>Returns the instance at the given position.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the instance's index<DT><B>Returns:</B><DD>the instance at the given position</DL></DD></DL><HR><A NAME="lastInstance()"><!-- --></A><H3>lastInstance</H3><PRE>public <A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> <B>lastInstance</B>()</PRE><DL><DD>Returns the last instance in the set.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the last instance in the set</DL></DD></DL><HR><A NAME="meanOrMode(int)"><!-- --></A><H3>meanOrMode</H3><PRE>public double <B>meanOrMode</B>(int attIndex)</PRE><DL><DD>Returns the mean (mode) for a numeric (nominal) attribute as a floating-point value. Returns 0 if the attribute is neither nominal nor numeric. If all values are missing it returns zero.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>attIndex</CODE> - the attribute's index<DT><B>Returns:</B><DD>the mean or the mode</DL></DD></DL><HR><A NAME="meanOrMode(weka.core.Attribute)"><!-- --></A><H3>meanOrMode</H3><PRE>public double <B>meanOrMode</B>(<A HREF="../../weka/core/Attribute.html" title="class in weka.core">Attribute</A> att)</PRE><DL><DD>Returns the mean (mode) for a numeric (nominal) attribute as a floating-point value. Returns 0 if the attribute is neither nominal nor numeric. If all values are missing it returns zero.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>att</CODE> - the attribute<DT><B>Returns:</B><DD>the mean or the mode</DL></DD></DL><HR><A NAME="numAttributes()"><!-- --></A><H3>numAttributes</H3><PRE>public int <B>numAttributes</B>()</PRE><DL><DD>Returns the number of attributes.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of attributes as an integer</DL></DD></DL><HR><A NAME="numClasses()"><!-- --></A><H3>numClasses</H3><PRE>public int <B>numClasses</B>()</PRE><DL><DD>Returns the number of class labels.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of class labels as an integer if the class attribute is nominal, 1 otherwise.<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="numDistinctValues(int)"><!-- --></A><H3>numDistinctValues</H3><PRE>public int <B>numDistinctValues</B>(int attIndex)</PRE><DL><DD>Returns the number of distinct values of a given attribute. Returns the number of instances if the attribute is a string attribute. The value 'missing' is not counted.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>attIndex</CODE> - the attribute<DT><B>Returns:</B><DD>the number of distinct values of a given attribute</DL></DD></DL><HR><A NAME="numDistinctValues(weka.core.Attribute)"><!-- --></A><H3>numDistinctValues</H3><PRE>public int <B>numDistinctValues</B>(<A HREF="../../weka/core/Attribute.html" title="class in weka.core">Attribute</A> att)</PRE><DL><DD>Returns the number of distinct values of a given attribute. Returns the number of instances if the attribute is a string attribute. The value 'missing' is not counted.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>att</CODE> - the attribute<DT><B>Returns:</B><DD>the number of distinct values of a given attribute</DL></DD></DL><HR><A NAME="numInstances()"><!-- --></A><H3>numInstances</H3><PRE>public int <B>numInstances</B>()</PRE><DL><DD>Returns the number of instances in the dataset.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of instances in the dataset as an integer</DL></DD></DL><HR><A NAME="randomize(java.util.Random)"><!-- --></A><H3>randomize</H3>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -