instances.html

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

HTML
1,714
字号
<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>&nbsp;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&nbsp;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>&nbsp;att,                              int&nbsp;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<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</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&nbsp;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 (index starts with 0)<DT><B>Returns:</B><DD>the instance at the given position</DL></DD></DL><HR><A NAME="kthSmallestValue(weka.core.Attribute, int)"><!-- --></A><H3>kthSmallestValue</H3><PRE>public double <B>kthSmallestValue</B>(<A HREF="../../weka/core/Attribute.html" title="class in weka.core">Attribute</A>&nbsp;att,                               int&nbsp;k)</PRE><DL><DD>Returns the kth-smallest attribute value of a numeric attribute. Note that calling this method will change the order of the data!<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>att</CODE> - the Attribute object<DD><CODE>k</CODE> - the value of k<DT><B>Returns:</B><DD>the kth-smallest value</DL></DD></DL><HR><A NAME="kthSmallestValue(int, int)"><!-- --></A><H3>kthSmallestValue</H3><PRE>public double <B>kthSmallestValue</B>(int&nbsp;attIndex,                               int&nbsp;k)</PRE><DL><DD>Returns the kth-smallest attribute value of a numeric attribute. Note that calling this method will change the order of the data! The number of non-missing values in the data must be as least as last as k for this to work.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>attIndex</CODE> - the attribute's index<DD><CODE>k</CODE> - the value of k<DT><B>Returns:</B><DD>the kth-smallest value</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&nbsp;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 (index starts with 0)<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>&nbsp;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&nbsp;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 (index starts with 0)<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>&nbsp;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><PRE>public void <B>randomize</B>(java.util.Random&nbsp;random)</PRE><DL><DD>Shuffles the instances in the set so that they are ordered  randomly.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>random</CODE> - a random number generator</DL></DD></DL><HR><A NAME="undoRandomizeAttribute()"><!-- --></A><H3>undoRandomizeAttribute</H3><PRE>public void <B>undoRandomizeAttribute</B>()                            throws java.lang.Exception</PRE><DL><DD>Does an undo of a previous call to randomizeAttribute, so that the original values of the attribute are restored. Only the original values before the last call to randomizeAttribute can be restored. Note, the original Instances object is modified.<P><DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if there was no call to randomizeAttribute or if attributes were added or removed since the last call to <code>randomizeAttribute</code><DT><B>See Also:</B><D

⌨️ 快捷键说明

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