instance.html

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

HTML
1,790
字号
<PRE>public static double <B>missingValue</B>()</PRE><DL><DD>Returns the double that codes "missing".<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the double that codes "missing"</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/UnassignedDatasetException.html" title="class in weka.core">UnassignedDatasetException</A></CODE> - if instance doesn't have access to any dataset</DL></DD></DL><HR><A NAME="numValues()"><!-- --></A><H3>numValues</H3><PRE>public int <B>numValues</B>()</PRE><DL><DD>Returns the number of values present. Always the same as numAttributes().<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of values</DL></DD></DL><HR><A NAME="replaceMissingValues(double[])"><!-- --></A><H3>replaceMissingValues</H3><PRE>public void <B>replaceMissingValues</B>(double[]&nbsp;array)</PRE><DL><DD>Replaces all missing values in the instance with the values contained in the given array. A deep copy of the vector of attribute values is performed before the values are replaced.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>array</CODE> - containing the means and modes<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if numbers of attributes are unequal</DL></DD></DL><HR><A NAME="setClassMissing()"><!-- --></A><H3>setClassMissing</H3><PRE>public void <B>setClassMissing</B>()</PRE><DL><DD>Sets the class value of an instance to be "missing". A deep copy of the vector of attribute values is performed before the value is set to be missing.<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 the class is not set<DD><CODE><A HREF="../../weka/core/UnassignedDatasetException.html" title="class in weka.core">UnassignedDatasetException</A></CODE> - if the instance doesn't have access to a dataset</DL></DD></DL><HR><A NAME="setClassValue(double)"><!-- --></A><H3>setClassValue</H3><PRE>public void <B>setClassValue</B>(double&nbsp;value)</PRE><DL><DD>Sets the class value of an instance to the given value (internal floating-point format).  A deep copy of the vector of attribute values is performed before the value is set.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>value</CODE> - the new attribute value (If the corresponding attribute is nominal (or a string) then this is the new value's index as a double).<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<DD><CODE>UnaddignedDatasetException</CODE> - if the instance doesn't have access to a dataset</DL></DD></DL><HR><A NAME="setClassValue(java.lang.String)"><!-- --></A><H3>setClassValue</H3><PRE>public final void <B>setClassValue</B>(java.lang.String&nbsp;value)</PRE><DL><DD>Sets the class value of an instance to the given value. A deep copy of the vector of attribute values is performed before the value is set.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>value</CODE> - the new class value (If the class is a string attribute and the value can't be found, the value is added to the 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<DD><CODE><A HREF="../../weka/core/UnassignedDatasetException.html" title="class in weka.core">UnassignedDatasetException</A></CODE> - if the dataset is not set<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the attribute is not nominal or a string, or the value couldn't be found for a nominal attribute</DL></DD></DL><HR><A NAME="setDataset(weka.core.Instances)"><!-- --></A><H3>setDataset</H3><PRE>public final void <B>setDataset</B>(<A HREF="../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;instances)</PRE><DL><DD>Sets the reference to the dataset. Does not check if the instance is compatible with the dataset. Note: the dataset does not know about this instance. If the structure of the dataset's header gets changed, this instance will not be adjusted automatically.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>instances</CODE> - the reference to the dataset</DL></DD></DL><HR><A NAME="setMissing(int)"><!-- --></A><H3>setMissing</H3><PRE>public final void <B>setMissing</B>(int&nbsp;attIndex)</PRE><DL><DD>Sets a specific value to be "missing". Performs a deep copy of the vector of attribute values before the value is set to be missing.<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="setMissing(weka.core.Attribute)"><!-- --></A><H3>setMissing</H3><PRE>public final void <B>setMissing</B>(<A HREF="../../weka/core/Attribute.html" title="class in weka.core">Attribute</A>&nbsp;att)</PRE><DL><DD>Sets a specific value to be "missing". Performs a deep copy of the vector of attribute values before the value is set to be missing. The given attribute has to belong to a dataset.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>att</CODE> - the attribute</DL></DD></DL><HR><A NAME="setValue(int, double)"><!-- --></A><H3>setValue</H3><PRE>public void <B>setValue</B>(int&nbsp;attIndex,                     double&nbsp;value)</PRE><DL><DD>Sets a specific value in the instance to the given value  (internal floating-point format). Performs a deep copy of the vector of attribute values before the value is set.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>attIndex</CODE> - the attribute's index<DD><CODE>value</CODE> - the new attribute value (If the corresponding attribute is nominal (or a string) then this is the new value's index as a double).</DL></DD></DL><HR><A NAME="setValueSparse(int, double)"><!-- --></A><H3>setValueSparse</H3><PRE>public void <B>setValueSparse</B>(int&nbsp;indexOfIndex,                           double&nbsp;value)</PRE><DL><DD>Sets a specific value in the instance to the given value  (internal floating-point format). Performs a deep copy of the vector of attribute values before the value is set. Does exactly the same thing as setValue().<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>indexOfIndex</CODE> - the index of the attribute's index<DD><CODE>value</CODE> - the new attribute value (If the corresponding attribute is nominal (or a string) then this is the new value's index as a double).</DL></DD></DL><HR><A NAME="setValue(int, java.lang.String)"><!-- --></A><H3>setValue</H3><PRE>public final void <B>setValue</B>(int&nbsp;attIndex,                           java.lang.String&nbsp;value)</PRE><DL><DD>Sets a value of a nominal or string attribute to the given value. Performs a deep copy of the vector of attribute values before the value is set.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>attIndex</CODE> - the attribute's index<DD><CODE>value</CODE> - the new attribute value (If the attribute is a string attribute and the value can't be found, the value is added to the attribute).<DT><B>Throws:</B><DD><CODE><A HREF="../../weka/core/UnassignedDatasetException.html" title="class in weka.core">UnassignedDatasetException</A></CODE> - if the dataset is not set<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the selected attribute is not nominal or a string, or the supplied value couldn't  be found for a nominal attribute</DL></DD></DL><HR><A NAME="setValue(weka.core.Attribute, double)"><!-- --></A><H3>setValue</H3><PRE>public final void <B>setValue</B>(<A HREF="../../weka/core/Attribute.html" title="class in weka.core">Attribute</A>&nbsp;att,                           double&nbsp;value)</PRE><DL><DD>Sets a specific value in the instance to the given value (internal floating-point format). Performs a deep copy of the vector of attribute values before the value is set, so if you are planning on calling setValue many times it may be faster to create a new instance using toDoubleArray.  The given attribute has to belong to a dataset.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>att</CODE> - the attribute<DD><CODE>value</CODE> - the new attribute value (If the corresponding attribute is nominal (or a string) then this is the new value's index as a double).</DL></DD></DL><HR><A NAME="setValue(weka.core.Attribute, java.lang.String)"><!-- --></A><H3>setValue</H3><PRE>public final void <B>setValue</B>(<A HREF="../../weka/core/Attribute.html" title="class in weka.core">Attribute</A>&nbsp;att,                           java.lang.String&nbsp;value)</PRE><DL><DD>Sets a value of an nominal or string attribute to the given value. Performs a deep copy of the vector of attribute values before the value is set, so if you are planning on calling setValue many times it may be faster to create a new instance using toDoubleArray. The given attribute has to belong to a dataset.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>att</CODE> - the attribute<DD><CODE>value</CODE> - the new attribute value (If the attribute is a string attribute and the value can't be found, the value is added to the attribute).<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the the attribute is not nominal or a string, or the value couldn't be found for a nominal attribute</DL></DD></DL><HR><A NAME="modifyValue(int, double)"><!-- --></A><H3>modifyValue</H3><PRE>public void <B>modifyValue</B>(int&nbsp;attIndex,                        double&nbsp;value)</PRE><DL><DD>Modifies the instances value for an attribute (floating point representation). Unlike in <code>setValue</code> no deep copy is produced, i.e. the actual value is modified.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>attIndex</CODE> - the attribute's index<DD><CODE>value</CODE> - the new attribute value (If the corresponding attribute is nominal (or a string) then this is the new value's index as a double).</DL></DD></DL><HR>

⌨️ 快捷键说明

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