⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sparseinstance.html

📁 < 数据挖掘--实用机器学习技术及java实现> 一书结合数据挖掘和机器学习的知识,作者陈述了自动挖掘模式的基础理论,并且以java语言实现了具有代表性的各类数据挖掘方法.例如:class
💻 HTML
📖 第 1 页 / 共 3 页
字号:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Main method for testing this class.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../weka/core/Instance.html">Instance</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/SparseInstance.html#mergeInstance(weka.core.Instance)">mergeInstance</A></B>(<A HREF="../../weka/core/Instance.html">Instance</A>&nbsp;inst)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Merges this instance with the given instance and returns the result.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/SparseInstance.html#numAttributes()">numAttributes</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of attributes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/SparseInstance.html#numValues()">numValues</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of values in the sparse vector.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/SparseInstance.html#replaceMissingValues(double[])">replaceMissingValues</A></B>(double[]&nbsp;array)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/SparseInstance.html#setValue(int, double)">setValue</A></B>(int&nbsp;attIndex,         double&nbsp;value)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/SparseInstance.html#setValueSparse(int, double)">setValueSparse</A></B>(int&nbsp;indexOfIndex,               double&nbsp;value)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;double[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/SparseInstance.html#toDoubleArray()">toDoubleArray</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/SparseInstance.html#toString()">toString</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;double</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/SparseInstance.html#value(int)">value</A></B>(int&nbsp;attIndex)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an instance's attribute value in internal format.</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_weka.core.Instance"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class weka.core.<A HREF="../../weka/core/Instance.html">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#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>&nbsp;<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>&nbsp;<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="m_Indices"><!-- --></A><H3>m_Indices</H3><PRE>protected int[] <B>m_Indices</B></PRE><DL><DD>The index of the attribute associated with each stored value.</DL><HR><A NAME="m_NumAttributes"><!-- --></A><H3>m_NumAttributes</H3><PRE>protected int <B>m_NumAttributes</B></PRE><DL><DD>The maximum number of values that can be stored.</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="SparseInstance()"><!-- --></A><H3>SparseInstance</H3><PRE>protected <B>SparseInstance</B>()</PRE><DL></DL><HR><A NAME="SparseInstance(weka.core.Instance)"><!-- --></A><H3>SparseInstance</H3><PRE>public <B>SparseInstance</B>(<A HREF="../../weka/core/Instance.html">Instance</A>&nbsp;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)<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="SparseInstance(weka.core.SparseInstance)"><!-- --></A><H3>SparseInstance</H3><PRE>public <B>SparseInstance</B>(<A HREF="../../weka/core/SparseInstance.html">SparseInstance</A>&nbsp;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)<DD><DL><DT><B>Parameters:</B><DD><CODE>instance</CODE> - the instance from which the attribute info is to be copied</DL></DD></DL><HR><A NAME="SparseInstance(double, double[])"><!-- --></A><H3>SparseInstance</H3><PRE>public <B>SparseInstance</B>(double&nbsp;weight,                      double[]&nbsp;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)<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="SparseInstance(double, double[], int[], int)"><!-- --></A><H3>SparseInstance</H3><PRE>public <B>SparseInstance</B>(double&nbsp;weight,                      double[]&nbsp;attValues,                      int[]&nbsp;indices,                      int&nbsp;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)<DD><DL><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<DD><CODE>maxNumValues</CODE> - the maximium number of values that can be stored</DL></DD></DL><HR><A NAME="SparseInstance(int)"><!-- --></A><H3>SparseInstance</H3><PRE>public <B>SparseInstance</B>(int&nbsp;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><!-- ============ 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="attributeSparse(int)"><!-- --></A><H3>attributeSparse</H3><PRE>public <A HREF="../../weka/core/Attribute.html">Attribute</A> <B>attributeSparse</B>(int&nbsp;indexOfIndex)</PRE><DL><DD>Returns the attribute associated with the internal index.<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">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">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

⌨️ 快捷键说明

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