📄 instance.html
字号:
<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<DT><B>Throws:</B><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="equalHeaders(weka.core.Instance)"><!-- --></A><H3>equalHeaders</H3><PRE>public boolean <B>equalHeaders</B>(<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> inst)</PRE><DL><DD>Tests if the headers of two instances are equivalent.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the header of the given instance is equivalent to this instance's header<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="hasMissingValue()"><!-- --></A><H3>hasMissingValue</H3><PRE>public boolean <B>hasMissingValue</B>()</PRE><DL><DD>Tests whether an instance has a missing value. Skips the class attribute if set.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if instance has a missing value.<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="index(int)"><!-- --></A><H3>index</H3><PRE>public int <B>index</B>(int position)</PRE><DL><DD>Returns the index of the attribute stored at the given position. Just returns the given value.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>position</CODE> - the position<DT><B>Returns:</B><DD>the index of the attribute stored at the given position</DL></DD></DL><HR><A NAME="insertAttributeAt(int)"><!-- --></A><H3>insertAttributeAt</H3><PRE>public void <B>insertAttributeAt</B>(int position)</PRE><DL><DD>Inserts an attribute at the given position (0 to numAttributes()). Only succeeds if the instance does not have access to any dataset because otherwise inconsistencies could be introduced.<P><DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE>java.lang.RuntimeException</CODE> - if the instance has accesss to a dataset<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the position is out of range</DL></DD></DL><HR><A NAME="isMissing(int)"><!-- --></A><H3>isMissing</H3><PRE>public boolean <B>isMissing</B>(int attIndex)</PRE><DL><DD>Tests if a specific value is "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="isMissingSparse(int)"><!-- --></A><H3>isMissingSparse</H3><PRE>public boolean <B>isMissingSparse</B>(int indexOfIndex)</PRE><DL><DD>Tests if a specific value is "missing". Does the same thing as isMissing() if applied to an Instance.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>indexOfIndex</CODE> - the index of the attribute's index</DL></DD></DL><HR><A NAME="isMissing(weka.core.Attribute)"><!-- --></A><H3>isMissing</H3><PRE>public boolean <B>isMissing</B>(<A HREF="../../weka/core/Attribute.html" title="class in weka.core">Attribute</A> att)</PRE><DL><DD>Tests if a specific value is "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="isMissingValue(double)"><!-- --></A><H3>isMissingValue</H3><PRE>public static boolean <B>isMissingValue</B>(double val)</PRE><DL><DD>Tests if the given value codes "missing".<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>val</CODE> - the value to be tested<DT><B>Returns:</B><DD>true if val codes "missing"</DL></DD></DL><HR><A NAME="mergeInstance(weka.core.Instance)"><!-- --></A><H3>mergeInstance</H3><PRE>public <A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> <B>mergeInstance</B>(<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> inst)</PRE><DL><DD>Merges this instance with the given instance and returns the result. Dataset is set to null.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>inst</CODE> - the instance to be merged with this one<DT><B>Returns:</B><DD>the merged instances</DL></DD></DL><HR><A NAME="missingValue()"><!-- --></A><H3>missingValue</H3><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[] 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 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 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> 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 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> 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 attIndex,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -