📄 instance.html
字号:
Returns the number of attributes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#numClasses()">numClasses</A></B>()</CODE><BR> Returns the number of class labels.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#numValues()">numValues</A></B>()</CODE><BR> Returns the number of values present.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#replaceMissingValues(double[])">replaceMissingValues</A></B>(double[] array)</CODE><BR> Replaces all missing values in the instance with the values contained in the given array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#setClassMissing()">setClassMissing</A></B>()</CODE><BR> Sets the class value of an instance to be "missing".</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#setClassValue(double)">setClassValue</A></B>(double value)</CODE><BR> Sets the class value of an instance to the given value (internal floating-point format).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#setClassValue(java.lang.String)">setClassValue</A></B>(java.lang.String value)</CODE><BR> Sets the class value of an instance to the given value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#setDataset(weka.core.Instances)">setDataset</A></B>(<A HREF="../../weka/core/Instances.html">Instances</A> instances)</CODE><BR> Sets the reference to the dataset.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#setMissing(weka.core.Attribute)">setMissing</A></B>(<A HREF="../../weka/core/Attribute.html">Attribute</A> att)</CODE><BR> Sets a specific value to be "missing".</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#setMissing(int)">setMissing</A></B>(int attIndex)</CODE><BR> Sets a specific value to be "missing".</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#setValue(weka.core.Attribute, double)">setValue</A></B>(<A HREF="../../weka/core/Attribute.html">Attribute</A> att, double value)</CODE><BR> Sets a specific value in the instance to the given value (internal floating-point format).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#setValue(weka.core.Attribute, java.lang.String)">setValue</A></B>(<A HREF="../../weka/core/Attribute.html">Attribute</A> att, java.lang.String value)</CODE><BR> Sets a value of an nominal or string attribute to the given value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#setValue(int, double)">setValue</A></B>(int attIndex, double value)</CODE><BR> Sets a specific value in the instance to the given value (internal floating-point format).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#setValue(int, java.lang.String)">setValue</A></B>(int attIndex, java.lang.String value)</CODE><BR> Sets a value of a nominal or string attribute to the given value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#setValueSparse(int, double)">setValueSparse</A></B>(int indexOfIndex, double value)</CODE><BR> Sets a specific value in the instance to the given value (internal floating-point format).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#setWeight(double)">setWeight</A></B>(double weight)</CODE><BR> Sets the weight of an instance.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#stringValue(weka.core.Attribute)">stringValue</A></B>(<A HREF="../../weka/core/Attribute.html">Attribute</A> att)</CODE><BR> Returns the value of a nominal (or string) attribute for the instance.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#stringValue(int)">stringValue</A></B>(int attIndex)</CODE><BR> Returns the value of a nominal (or string) attribute for the instance.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#toDoubleArray()">toDoubleArray</A></B>()</CODE><BR> Returns the values of each attribute as an array of doubles.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#toString()">toString</A></B>()</CODE><BR> Returns the description of one instance.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#toString(weka.core.Attribute)">toString</A></B>(<A HREF="../../weka/core/Attribute.html">Attribute</A> att)</CODE><BR> Returns the description of one value of the instance as a string.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#toString(int)">toString</A></B>(int attIndex)</CODE><BR> Returns the description of one value of the instance as a string.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#value(weka.core.Attribute)">value</A></B>(<A HREF="../../weka/core/Attribute.html">Attribute</A> att)</CODE><BR> Returns an instance's attribute value in internal format.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#value(int)">value</A></B>(int attIndex)</CODE><BR> Returns an instance's attribute value in internal format.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#valueSparse(int)">valueSparse</A></B>(int indexOfIndex)</CODE><BR> Returns an instance's attribute value in internal format.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> double</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/Instance.html#weight()">weight</A></B>()</CODE><BR> Returns the instance's weight.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.Object</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="MISSING_VALUE"><!-- --></A><H3>MISSING_VALUE</H3><PRE>protected static final double <B>MISSING_VALUE</B></PRE><DL><DD>Constant representing a missing value.</DL><HR><A NAME="m_Dataset"><!-- --></A><H3>m_Dataset</H3><PRE>protected <A HREF="../../weka/core/Instances.html">Instances</A> <B>m_Dataset</B></PRE><DL><DD>The dataset the instance has access to. Null if the instance doesn't have access to any dataset. Only if an instance has access to a dataset, it knows about the actual attribute types.</DL><HR><A NAME="m_AttValues"><!-- --></A><H3>m_AttValues</H3><PRE>protected double[] <B>m_AttValues</B></PRE><DL><DD>The instance's attribute values.</DL><HR><A NAME="m_Weight"><!-- --></A><H3>m_Weight</H3><PRE>protected double <B>m_Weight</B></PRE><DL><DD>The instance's weight.</DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="Instance(weka.core.Instance)"><!-- --></A><H3>Instance</H3><PRE>public <B>Instance</B>(<A HREF="../../weka/core/Instance.html">Instance</A> instance)</PRE><DL><DD>Constructor that copies the attribute values and the weight from the given instance. Reference to the dataset is set to null. (ie. the instance doesn't have access to information about the attribute types)<DD><DL><DT><B>Parameters:</B><DD><CODE>instance</CODE> - the instance from which the attribute values and the weight are to be copied</DL></DD></DL><HR><A NAME="Instance(double, double[])"><!-- --></A><H3>Instance</H3><PRE>public <B>Instance</B>(double weight, double[] attValues)</PRE><DL><DD>Constructor that inititalizes instance variable with given values. Reference to the dataset is set to null. (ie. the instance doesn't have access to information about the attribute types)<DD><DL><DT><B>Parameters:</B><DD><CODE>weight</CODE> - the instance's weight<DD><CODE>attValues</CODE> - a vector of attribute values</DL></DD></DL><HR><A NAME="Instance(int)"><!-- --></A><H3>Instance</H3><PRE>public <B>Instance</B>(int numAttributes)</PRE><DL><DD>Constructor of an instance that sets weight to one, all values to be missing, and the reference to the dataset to null. (ie. the instance doesn't have access to information about the attribute types)<DD><DL><DT><B>Parameters:</B><DD><CODE>numAttributes</CODE> - the size of the instance</DL></DD></DL><HR><A NAME="Instance()"><!-- --></A><H3>Instance</H3><PRE>protected <B>Instance</B>()</PRE><DL><DD>Private constructor for subclasses. Does nothing.</DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="attribute(int)"><!-- --></A><H3>attribute</H3><PRE>public <A HREF="../../weka/core/Attribute.html">Attribute</A> <B>attribute</B>(int index)</PRE><DL><DD>Returns the attribute with the given index.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the attribute's index<DT><B>Returns:</B><DD>the attribute at the given position<DT><B>Throws:</B><DD><CODE><A HREF="../../weka/core/UnassignedDatasetException.html">UnassignedDatasetException</A></CODE> - if instance doesn't have access to a dataset</DL></DD></DL><HR><A NAME="attributeSparse(int)"><!-- --></A><H3>attributeSparse</H3><PRE>public <A HREF="../../weka/core/Attribute.html">Attribute</A> <B>attributeSparse</B>(int indexOfIndex)</PRE><DL><DD>Returns the attribute with the given index. Does the same thing as attribute().<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>indexOfIndex</CODE> - the index of the attribute's index<DT><B>Returns:</B><DD>the attribute at the given position<DT><B>Throws:</B><DD><CODE><A HREF="../../weka/core/UnassignedDatasetException.html">UnassignedDatasetException</A></CODE> - if instance doesn't have access to a dataset</DL></DD></DL><HR><A NAME="classAttribute()"><!-- --></A><H3>classAttribute</H3><PRE>public <A HREF="../../weka/core/Attribute.html">Attribute</A> <B>classAttribute</B>()</PRE><DL><DD>Returns class attribute.<DD><DL></DL></DD><DD><DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -