📄 instances.html
字号:
<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 attIndex, int 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 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> 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 (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> 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 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="readInstance(java.io.Reader)"><!-- --></A><H3>readInstance</H3><PRE>public boolean <B>readInstance</B>(java.io.Reader reader) throws java.io.IOException</PRE><DL><DD>Reads a single instance from the reader and appends it to the dataset. Automatically expands the dataset if it is not large enough to hold the instance. This method does not check for carriage return at the end of the line.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>reader</CODE> - the reader<DT><B>Returns:</B><DD>false if end of file has been reached<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if the information is not read successfully</DL></DD></DL><HR><A NAME="relationName()"><!-- --></A><H3>relationName</H3><PRE>public java.lang.String <B>relationName</B>()</PRE><DL><DD>Returns the relation's name.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the relation's name as a string</DL></DD></DL><HR><A NAME="renameAttribute(int, java.lang.String)"><!-- --></A><H3>renameAttribute</H3><PRE>public void <B>renameAttribute</B>(int att, java.lang.String name)</PRE><DL><DD>Renames an attribute. This change only affects this dataset.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>att</CODE> - the attribute's index (index starts with 0)<DD><CODE>name</CODE> - the new name</DL></DD></DL><HR><A NAME="renameAttribute(weka.core.Attribute, java.lang.String)"><!-- --></A><H3>renameAttribute</H3><PRE>public void <B>renameAttribute</B>(<A HREF="../../weka/core/Attribute.html" title="class in weka.core">Attribute</A> att, java.lang.String name)</PRE><DL><DD>Renames an attribute. This change only affects this dataset.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>att</CODE> - the attribute<DD><CODE>name</CODE> - the new name</DL></DD></DL><HR><A NAME="renameAttributeValue(int, int, java.lang.String)"><!-- --></A><H3>renameAttributeValue</H3><PRE>public void <B>renameAttributeValue</B>(int att, int val, java.lang.String name)</PRE><DL><DD>Renames the value of a nominal (or string) attribute value. This change only affects this dataset.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>att</CODE> - the attribute's index (index starts with 0)<DD><CODE>val</CODE> - the value's index (index starts with 0)<DD><CODE>name</CODE> - the new name</DL></DD></DL><HR><A NAME="renameAttributeValue(weka.core.Attribute, java.lang.String, java.lang.String)"><!-- --></A><H3>renameAttributeValue</H3><PRE>public void <B>renameAttributeValue</B>(<A HREF="../../weka/core/Attribute.html" title="class in weka.core">Attribute</A> att, java.lang.String val, java.lang.String name)</PRE><DL><DD>Renames the value of a nominal (or string) attribute value. This change only affects this dataset.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>att</CODE> - the attribute<DD><CODE>val</CODE> - the value<DD><CODE>name</CODE> - the new name</DL></DD></DL><HR><A NAME="resample(java.util.Random)"><!-- --></A><H3>resample</H3><PRE>public <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> <B>resample</B>(java.util.Random random)</PRE><DL><DD>Creates a new dataset of the same size using random sampling with replacement.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>random</CODE> - a random number generator<DT><B>Returns:</B><DD>the new dataset</DL></DD></DL><HR><A NAME="resampleWithWeights(java.util.Random)"><!-- --></A><H3>resampleWithWeights</H3><PRE>public <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> <B>resampleWithWeights</B>(java.util.Random random)</PRE><DL><DD>Creates a new dataset of the same size using random sampling with replacement according to the current instance weights. The weights of the instances in the new dataset are set to one.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>random</CODE> - a random number generator<DT><B>Returns:</B><DD>the new dataset</DL></DD></DL><HR><A NAME="resampleWithWeights(java.util.Random, double[])"><!-- --></A><H3>resampleWithWeights</H3><PRE>public <A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A> <B>resampleWithWeights</B>(java.util.Random random, double[] weights)</PRE><DL><DD>Creates a new dataset of the same size using random sampling with replacement according to the given weight vector. The weights of the instances in the new dataset are set to one. The length of the weight vector ha
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -