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

📄 filter.html

📁 < 数据挖掘--实用机器学习技术及java实现> 一书结合数据挖掘和机器学习的知识,作者陈述了自动挖掘模式的基础理论,并且以java语言实现了具有代表性的各类数据挖掘方法.例如:class
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!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:51 CDT 2002 --><TITLE>: Class  Filter</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/filters/EmptyAttributeFilter.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../weka/filters/FirstOrderFilter.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="Filter.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="#field_summary">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;<A HREF="#field_detail">FIELD</A>&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.filters</FONT><BR>Class  Filter</H2><PRE>java.lang.Object  |  +--<B>weka.filters.Filter</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable</DD></DL><DL><DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../weka/filters/AbstractTimeSeriesFilter.html">AbstractTimeSeriesFilter</A>, <A HREF="../../weka/filters/AddFilter.html">AddFilter</A>, <A HREF="../../weka/filters/AllFilter.html">AllFilter</A>, <A HREF="../../weka/filters/AttributeExpressionFilter.html">AttributeExpressionFilter</A>, <A HREF="../../weka/filters/AttributeFilter.html">AttributeFilter</A>, <A HREF="../../weka/filters/AttributeSelectionFilter.html">AttributeSelectionFilter</A>, <A HREF="../../weka/filters/AttributeTypeFilter.html">AttributeTypeFilter</A>, <A HREF="../../weka/filters/CopyAttributesFilter.html">CopyAttributesFilter</A>, <A HREF="../../weka/filters/DiscretizeFilter.html">DiscretizeFilter</A>, <A HREF="../../weka/filters/EmptyAttributeFilter.html">EmptyAttributeFilter</A>, <A HREF="../../weka/filters/FirstOrderFilter.html">FirstOrderFilter</A>, <A HREF="../../weka/filters/InstanceFilter.html">InstanceFilter</A>, <A HREF="../../weka/filters/MakeIndicatorFilter.html">MakeIndicatorFilter</A>, <A HREF="../../weka/filters/MergeTwoValuesFilter.html">MergeTwoValuesFilter</A>, <A HREF="../../weka/filters/NominalToBinaryFilter.html">NominalToBinaryFilter</A>, <A HREF="../../weka/filters/NonSparseToSparseFilter.html">NonSparseToSparseFilter</A>, <A HREF="../../weka/filters/NormalizationFilter.html">NormalizationFilter</A>, <A HREF="../../weka/filters/NullFilter.html">NullFilter</A>, <A HREF="../../weka/filters/NumericToBinaryFilter.html">NumericToBinaryFilter</A>, <A HREF="../../weka/filters/NumericTransformFilter.html">NumericTransformFilter</A>, <A HREF="../../weka/filters/ObfuscateFilter.html">ObfuscateFilter</A>, <A HREF="../../weka/filters/RandomizeFilter.html">RandomizeFilter</A>, <A HREF="../../weka/filters/ReplaceMissingValuesFilter.html">ReplaceMissingValuesFilter</A>, <A HREF="../../weka/filters/ResampleFilter.html">ResampleFilter</A>, <A HREF="../../weka/filters/SparseToNonSparseFilter.html">SparseToNonSparseFilter</A>, <A HREF="../../weka/filters/SplitDatasetFilter.html">SplitDatasetFilter</A>, <A HREF="../../weka/filters/SpreadSubsampleFilter.html">SpreadSubsampleFilter</A>, <A HREF="../../weka/filters/StringToNominalFilter.html">StringToNominalFilter</A>, <A HREF="../../weka/filters/SwapAttributeValuesFilter.html">SwapAttributeValuesFilter</A></DD></DL><HR><DL><DT>public abstract class <B>Filter</B><DT>extends java.lang.Object<DT>implements java.io.Serializable</DL><P>An abstract class for instance filters: objects that take instances as input, carry out some transformation on the instance and then output the instance. The method implementations in this class assume that most of the work will be done in the methods overridden by subclasses.<p> A simple example of filter use. This example doesn't remove instances from the output queue until all instances have been input, so has higher memory consumption than an approach that uses output instances as they are made available:<p> <code> <pre>  Filter filter = ..some type of filter..  Instances instances = ..some instances..  for (int i = 0; i < data.numInstances(); i++) {    filter.input(data.instance(i));  }  filter.batchFinished();  Instances newData = filter.outputFormat();  Instance processed;  while ((processed = filter.output()) != null) {    newData.add(processed);  }  ..do something with newData.. </pre> </code><P><DL><DT><B>See Also: </B><DD><A HREF="../../serialized-form.html#weka.filters.Filter">Serialized Form</A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#m_NewBatch">m_NewBatch</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Record whether the filter is at the start of a batch</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/filters/Filter.html#Filter()">Filter</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#batchFilterFile(weka.filters.Filter, java.lang.String[])">batchFilterFile</A></B>(<A HREF="../../weka/filters/Filter.html">Filter</A>&nbsp;filter,                java.lang.String[]&nbsp;options)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method for testing filters ability to process multiple batches.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#batchFinished()">batchFinished</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Signify that this batch of input to the filter is finished.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#bufferInput(weka.core.Instance)">bufferInput</A></B>(<A HREF="../../weka/core/Instance.html">Instance</A>&nbsp;instance)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds the supplied input instance to the inputformat dataset for later processing.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#copyStringValues(weka.core.Instance, boolean, weka.core.Instances, weka.core.Instances)">copyStringValues</A></B>(<A HREF="../../weka/core/Instance.html">Instance</A>&nbsp;instance,                 boolean&nbsp;instSrcCompat,                 <A HREF="../../weka/core/Instances.html">Instances</A>&nbsp;srcDataset,                 <A HREF="../../weka/core/Instances.html">Instances</A>&nbsp;destDataset)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Takes string values referenced by an Instance and copies them from a source dataset to a destination dataset.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#copyStringValues(weka.core.Instance, boolean, weka.core.Instances, int[], weka.core.Instances, int[])">copyStringValues</A></B>(<A HREF="../../weka/core/Instance.html">Instance</A>&nbsp;instance,                 boolean&nbsp;instSrcCompat,                 <A HREF="../../weka/core/Instances.html">Instances</A>&nbsp;srcDataset,                 int[]&nbsp;srcStrAtts,                 <A HREF="../../weka/core/Instances.html">Instances</A>&nbsp;destDataset,                 int[]&nbsp;destStrAtts)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Takes string values referenced by an Instance and copies them from a source dataset to a destination dataset.</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/filters/Filter.html#filterFile(weka.filters.Filter, java.lang.String[])">filterFile</A></B>(<A HREF="../../weka/filters/Filter.html">Filter</A>&nbsp;filter,           java.lang.String[]&nbsp;options)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method for testing filters.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#flushInput()">flushInput</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This will remove all buffered instances from the inputformat dataset.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;<A HREF="../../weka/core/Instances.html">Instances</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#getInputFormat()">getInputFormat</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the currently set inputformat instances.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;int[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#getInputStringIndex()">getInputStringIndex</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an array containing the indices of all string attributes in the input format.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../weka/core/Instances.html">Instances</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#getOutputFormat()">getOutputFormat</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the format of the output instances.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;int[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#getOutputStringIndex()">getOutputStringIndex</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an array containing the indices of all string attributes in the output format.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;int[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#getStringIndices(weka.core.Instances)">getStringIndices</A></B>(<A HREF="../../weka/core/Instances.html">Instances</A>&nbsp;insts)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets an array containing the indices of all string attributes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#input(weka.core.Instance)">input</A></B>(<A HREF="../../weka/core/Instance.html">Instance</A>&nbsp;instance)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Input an instance for filtering.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#inputFormat(weka.core.Instances)">inputFormat</A></B>(<A HREF="../../weka/core/Instances.html">Instances</A>&nbsp;instanceInfo)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>use <code>setInputFormat(Instances)</code> instead.</I></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#isOutputFormatDefined()">isOutputFormatDefined</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns whether the output format is ready to be collected</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/filters/Filter.html#main(java.lang.String[])">main</A></B>(java.lang.String[]&nbsp;args)</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;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../weka/filters/Filter.html#numPendingOutput()">numPendingOutput</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of instances pending output</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/filters/Filter.html#output()">output</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Output an instance after filtering and remove from the output queue.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../weka/core/Instances.html">Instances</A></CODE></FONT></TD>

⌨️ 快捷键说明

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