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

📄 binarysparseinstance.html

📁 这是一个由java实现的数据挖掘
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Wed Sep 04 10:31:50 CDT 2002 --><TITLE>: Class  BinarySparseInstance</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../weka/core/AttributeStats.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../weka/core/CheckOptionHandler.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="BinarySparseInstance.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_weka.core.SparseInstance">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">weka.core</FONT><BR>Class  BinarySparseInstance</H2><PRE>java.lang.Object  |  +--<A HREF="../../weka/core/Instance.html">weka.core.Instance</A>        |        +--<A HREF="../../weka/core/SparseInstance.html">weka.core.SparseInstance</A>              |              +--<B>weka.core.BinarySparseInstance</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../weka/core/Copyable.html">Copyable</A>, java.io.Serializable</DD></DL><HR><DL><DT>public class <B>BinarySparseInstance</B><DT>extends <A HREF="../../weka/core/SparseInstance.html">SparseInstance</A></DL><P>Class for storing a binary-data-only instance as a sparse vector. A sparse instance only requires storage for those attribute values that are non-zero.  Since the objective is to reduce storage requirements for datasets with large numbers of default values, this also includes nominal attributes -- the first nominal value (i.e. that which has index 0) will not require explicit storage, so rearrange your nominal attribute value orderings if necessary. Missing values are not supported, and will be treated as  1 (true).<P><DL><DT><B>See Also: </B><DD><A HREF="../../serialized-form.html#weka.core.BinarySparseInstance">Serialized Form</A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="fields_inherited_from_class_weka.core.SparseInstance"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from class weka.core.<A HREF="../../weka/core/SparseInstance.html">SparseInstance</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../weka/core/SparseInstance.html#m_Indices">m_Indices</A>, <A HREF="../../weka/core/SparseInstance.html#m_NumAttributes">m_NumAttributes</A></CODE></TD></TR></TABLE>&nbsp;<A NAME="fields_inherited_from_class_weka.core.Instance"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields 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#m_AttValues">m_AttValues</A>, <A HREF="../../weka/core/Instance.html#m_Dataset">m_Dataset</A>, <A HREF="../../weka/core/Instance.html#m_Weight">m_Weight</A>, <A HREF="../../weka/core/Instance.html#MISSING_VALUE">MISSING_VALUE</A></CODE></TD></TR></TABLE>&nbsp;<!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../weka/core/BinarySparseInstance.html#BinarySparseInstance(double, double[])">BinarySparseInstance</A></B>(double&nbsp;weight,                     double[]&nbsp;attValues)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor that generates a sparse instance from the given parameters.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../weka/core/BinarySparseInstance.html#BinarySparseInstance(double, int[], int)">BinarySparseInstance</A></B>(double&nbsp;weight,                     int[]&nbsp;indices,                     int&nbsp;maxNumValues)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor that inititalizes instance variable with given values.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../weka/core/BinarySparseInstance.html#BinarySparseInstance(weka.core.Instance)">BinarySparseInstance</A></B>(<A HREF="../../weka/core/Instance.html">Instance</A>&nbsp;instance)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor that generates a sparse instance from the given instance.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../weka/core/BinarySparseInstance.html#BinarySparseInstance(int)">BinarySparseInstance</A></B>(int&nbsp;numAttributes)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor of an instance that sets weight to one, all values to 1, and the reference to the dataset to null.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../weka/core/BinarySparseInstance.html#BinarySparseInstance(weka.core.SparseInstance)">BinarySparseInstance</A></B>(<A HREF="../../weka/core/SparseInstance.html">SparseInstance</A>&nbsp;instance)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor that copies the info from the given instance.</TD></TR></TABLE>&nbsp;<!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.Object</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/BinarySparseInstance.html#copy()">copy</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Produces a shallow copy of this instance.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/BinarySparseInstance.html#main(java.lang.String[])">main</A></B>(java.lang.String[]&nbsp;options)</CODE><BR>&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/BinarySparseInstance.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;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/core/BinarySparseInstance.html#replaceMissingValues(double[])">replaceMissingValues</A></B>(double[]&nbsp;array)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Does nothing, since we don't support missing values.</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/BinarySparseInstance.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/BinarySparseInstance.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/BinarySparseInstance.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/BinarySparseInstance.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/BinarySparseInstance.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><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/BinarySparseInstance.html#valueSparse(int)">valueSparse</A></B>(int&nbsp;indexOfIndex)</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.SparseInstance"><!-- --></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/SparseInstance.html">SparseInstance</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../weka/core/SparseInstance.html#attributeSparse(int)">attributeSparse</A>, <A HREF="../../weka/core/SparseInstance.html#index(int)">index</A>, <A HREF="../../weka/core/SparseInstance.html#isMissing(int)">isMissing</A>, <A HREF="../../weka/core/SparseInstance.html#locateIndex(int)">locateIndex</A>, <A HREF="../../weka/core/SparseInstance.html#numAttributes()">numAttributes</A>, <A HREF="../../weka/core/SparseInstance.html#numValues()">numValues</A></CODE></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#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 =========== --><!-- ========= CONSTRUCTOR DETAIL ======== -->

⌨️ 快捷键说明

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