📄 sparseinstance.html
字号:
</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/SparseInstance.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/SparseInstance.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/SparseInstance.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> double[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/SparseInstance.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/SparseInstance.html#toString()">toString</A></B>()</CODE><BR> Returns the description of one instance in sparse 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/SparseInstance.html#value(int)">value</A></B>(int attIndex)</CODE><BR> Returns an instance's attribute value in internal format.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_weka.core.Instance"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class weka.core.<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../weka/core/Instance.html#attribute(int)">attribute</A>, <A HREF="../../weka/core/Instance.html#classAttribute()">classAttribute</A>, <A HREF="../../weka/core/Instance.html#classIndex()">classIndex</A>, <A HREF="../../weka/core/Instance.html#classIsMissing()">classIsMissing</A>, <A HREF="../../weka/core/Instance.html#classValue()">classValue</A>, <A HREF="../../weka/core/Instance.html#dataset()">dataset</A>, <A HREF="../../weka/core/Instance.html#deleteAttributeAt(int)">deleteAttributeAt</A>, <A HREF="../../weka/core/Instance.html#enumerateAttributes()">enumerateAttributes</A>, <A HREF="../../weka/core/Instance.html#equalHeaders(weka.core.Instance)">equalHeaders</A>, <A HREF="../../weka/core/Instance.html#hasMissingValue()">hasMissingValue</A>, <A HREF="../../weka/core/Instance.html#insertAttributeAt(int)">insertAttributeAt</A>, <A HREF="../../weka/core/Instance.html#isMissing(weka.core.Attribute)">isMissing</A>, <A HREF="../../weka/core/Instance.html#isMissingSparse(int)">isMissingSparse</A>, <A HREF="../../weka/core/Instance.html#isMissingValue(double)">isMissingValue</A>, <A HREF="../../weka/core/Instance.html#missingValue()">missingValue</A>, <A HREF="../../weka/core/Instance.html#numClasses()">numClasses</A>, <A HREF="../../weka/core/Instance.html#setClassMissing()">setClassMissing</A>, <A HREF="../../weka/core/Instance.html#setClassValue(double)">setClassValue</A>, <A HREF="../../weka/core/Instance.html#setClassValue(java.lang.String)">setClassValue</A>, <A HREF="../../weka/core/Instance.html#setDataset(weka.core.Instances)">setDataset</A>, <A HREF="../../weka/core/Instance.html#setMissing(weka.core.Attribute)">setMissing</A>, <A HREF="../../weka/core/Instance.html#setMissing(int)">setMissing</A>, <A HREF="../../weka/core/Instance.html#setValue(weka.core.Attribute, double)">setValue</A>, <A HREF="../../weka/core/Instance.html#setValue(weka.core.Attribute, java.lang.String)">setValue</A>, <A HREF="../../weka/core/Instance.html#setValue(int, java.lang.String)">setValue</A>, <A HREF="../../weka/core/Instance.html#setWeight(double)">setWeight</A>, <A HREF="../../weka/core/Instance.html#stringValue(weka.core.Attribute)">stringValue</A>, <A HREF="../../weka/core/Instance.html#stringValue(int)">stringValue</A>, <A HREF="../../weka/core/Instance.html#toString(weka.core.Attribute)">toString</A>, <A HREF="../../weka/core/Instance.html#toString(int)">toString</A>, <A HREF="../../weka/core/Instance.html#value(weka.core.Attribute)">value</A>, <A HREF="../../weka/core/Instance.html#valueSparse(int)">valueSparse</A>, <A HREF="../../weka/core/Instance.html#weight()">weight</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.Object</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>equals, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="SparseInstance(weka.core.Instance)"><!-- --></A><H3>SparseInstance</H3><PRE>public <B>SparseInstance</B>(<A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A> instance)</PRE><DL><DD>Constructor that generates a sparse instance 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)<P><DT><B>Parameters:</B><DD><CODE>instance</CODE> - the instance from which the attribute values and the weight are to be copied</DL><HR><A NAME="SparseInstance(weka.core.SparseInstance)"><!-- --></A><H3>SparseInstance</H3><PRE>public <B>SparseInstance</B>(<A HREF="../../weka/core/SparseInstance.html" title="class in weka.core">SparseInstance</A> instance)</PRE><DL><DD>Constructor that copies the info 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)<P><DT><B>Parameters:</B><DD><CODE>instance</CODE> - the instance from which the attribute info is to be copied</DL><HR><A NAME="SparseInstance(double, double[])"><!-- --></A><H3>SparseInstance</H3><PRE>public <B>SparseInstance</B>(double weight, double[] attValues)</PRE><DL><DD>Constructor that generates a sparse instance from the given parameters. Reference to the dataset is set to null. (ie. the instance doesn't have access to information about the attribute types)<P><DT><B>Parameters:</B><DD><CODE>weight</CODE> - the instance's weight<DD><CODE>attValues</CODE> - a vector of attribute values</DL><HR><A NAME="SparseInstance(double, double[], int[], int)"><!-- --></A><H3>SparseInstance</H3><PRE>public <B>SparseInstance</B>(double weight, double[] attValues, int[] indices, int maxNumValues)</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) Note that the indices need to be sorted in ascending order. Otherwise things won't work properly.<P><DT><B>Parameters:</B><DD><CODE>weight</CODE> - the instance's weight<DD><CODE>attValues</CODE> - a vector of attribute values (just the ones to be stored)<DD><CODE>indices</CODE> - the indices of the given values in the full vector (need to be sorted in ascending order)<DD><CODE>maxNumValues</CODE> - the maximium number of values that can be stored</DL><HR><A NAME="SparseInstance(int)"><!-- --></A><H3>SparseInstance</H3><PRE>public <B>SparseInstance</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)<P><DT><B>Parameters:</B><DD><CODE>numAttributes</CODE> - the size of the instance</DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="attributeSparse(int)"><!-- --></A><H3>attributeSparse</H3><PRE>public <A HREF="../../weka/core/Attribute.html" title="class in weka.core">Attribute</A> <B>attributeSparse</B>(int indexOfIndex)</PRE><DL><DD>Returns the attribute associated with the internal index.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../weka/core/Instance.html#attributeSparse(int)">attributeSparse</A></CODE> in class <CODE><A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A></CODE></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" title="class in weka.core">UnassignedDatasetException</A></CODE> - if instance doesn't have access to a dataset</DL></DD></DL><HR><A NAME="copy()"><!-- --></A><H3>copy</H3><PRE>public java.lang.Object <B>copy</B>()</PRE><DL><DD>Produces a shallow copy of this instance. The copy has access to the same dataset. (if you want to make a copy that doesn't have access to the dataset, use <code>new SparseInstance(instance)</code><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../weka/core/Copyable.html#copy()">copy</A></CODE> in interface <CODE><A HREF="../../weka/core/Copyable.html" title="interface in weka.core">Copyable</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../weka/core/Instance.html#copy()">copy</A></CODE> in class <CODE><A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the shallow copy</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.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../weka/core/Instance.html#index(int)">index</A></CODE> in class <CODE><A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A></CODE></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="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><DT><B>Overrides:</B><DD><CODE><A HREF="../../weka/core/Instance.html#isMissing(int)">isMissing</A></CODE> in class <CODE><A HREF="../../weka/core/Instance.html" title="class in weka.core">Instance</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>attIndex</CODE> - the attribute's index</DL></DD></DL><HR><A NAME="locateIndex(int)"><!-- --></A><H3>locateIndex</H3><PRE>public int <B>locateIndex</B>(int index)</PRE><DL><DD>Locates the greatest index that is not greater than the given index.<P><DD><DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -