instancesutil.html

来自「weka是机器学习和数据挖掘领域最有影响力的开源项目之一」· HTML 代码 · 共 1,072 行 · 第 1/4 页

HTML
1,072
字号
                                     throws java.lang.IllegalArgumentException</PRE><DL><DD>Calculatutes the number of vectors in the data space that are smaller  or equal than the given instance.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>instance</CODE> - the given instance<DT><B>Returns:</B><DD>the number of vectors in the data space smaller or equal  than the given instance<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if there are numeric attributes</DL></DD></DL><HR><A NAME="numberOfGreaterVectors(weka.core.Instance)"><!-- --></A><H3>numberOfGreaterVectors</H3><PRE>public static double <B>numberOfGreaterVectors</B>(<A HREF="../../../../weka/core/Instance.html" title="class in weka.core">Instance</A>&nbsp;instance)                                     throws java.lang.IllegalArgumentException</PRE><DL><DD>Calculatutes the number of vectors in the data space that are  greater or equal than the given instance.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>instance</CODE> - the given instance<DT><B>Returns:</B><DD>the number of vectors in the data space greater of equal than the given instance<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if there are numeric attributes</DL></DD></DL><HR><A NAME="write(weka.core.Instances, java.io.BufferedWriter)"><!-- --></A><H3>write</H3><PRE>public static void <B>write</B>(<A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;instances,                         java.io.BufferedWriter&nbsp;file)                  throws java.io.IOException</PRE><DL><DD>Write the instances in ARFF-format to the indicated  <code> BufferedWriter </code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>instances</CODE> - the instances to write<DD><CODE>file</CODE> - the <code> BufferedWriter </code> to write to<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if something goes wrong while writing the instances</DL></DD></DL><HR><A NAME="countValues(weka.core.Instances, int)"><!-- --></A><H3>countValues</H3><PRE>public static <A HREF="../../../../weka/estimators/DiscreteEstimator.html" title="class in weka.estimators">DiscreteEstimator</A> <B>countValues</B>(<A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;instances,                                            int&nbsp;attributeIndex)                                     throws java.lang.IllegalArgumentException</PRE><DL><DD>Return a histogram of the values for the specified attribute.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>instances</CODE> - the instances<DD><CODE>attributeIndex</CODE> - the attribute to consider<DT><B>Returns:</B><DD>a <code> DiscreteEstimator </code> where the <code>i</code>th<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the attribute at the specified  index is numeric</DL></DD></DL><HR><A NAME="sampleWithoutReplacement(weka.core.Instances, int, java.util.Random)"><!-- --></A><H3>sampleWithoutReplacement</H3><PRE>public static <A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A> <B>sampleWithoutReplacement</B>(<A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;instances,                                                 int&nbsp;size,                                                 java.util.Random&nbsp;random)</PRE><DL><DD>Create, without replacement, a random subsample of the given size  from the given instances.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>instances</CODE> - the instances to sample from<DD><CODE>size</CODE> - the requested size of the sample<DD><CODE>random</CODE> - the random generator to use<DT><B>Returns:</B><DD>a sample of the requested size, drawn from the given instances without replacement<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the size exceeds the number of instances</DL></DD></DL><HR><A NAME="generateRandomSample(weka.core.Instances, int, java.util.Random)"><!-- --></A><H3>generateRandomSample</H3><PRE>public static <A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A> <B>generateRandomSample</B>(<A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;headerInfo,                                             int&nbsp;numberOfExamples,                                             java.util.Random&nbsp;random)                                      throws java.lang.IllegalArgumentException</PRE><DL><DD>Generates a random sample of instances.  Each attribute must be nominal, and the  class labels are not set.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>headerInfo</CODE> - Instances whose header information is used to determine how the  set of returned instances will look<DD><CODE>numberOfExamples</CODE> - the desired size of the returned set<DD><CODE>random</CODE> - the random number generator to use<DT><B>Returns:</B><DD>a set of Instances containing the random sample.<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if numeric attributes are given</DL></DD></DL><HR><A NAME="toDataDouble(weka.core.Instance)"><!-- --></A><H3>toDataDouble</H3><PRE>public static double[] <B>toDataDouble</B>(<A HREF="../../../../weka/core/Instance.html" title="class in weka.core">Instance</A>&nbsp;instance)</PRE><DL><DD>Returns an array containing the attribute values (in internal floating  point format) of the given instance in data space, this is, the class  attribute (if any) is removed.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>instance</CODE> - the instance to get the attribute values from<DT><B>Returns:</B><DD>array of doubles containing the attribute values</DL></DD></DL><HR><A NAME="minimalExtension(weka.core.Instances, weka.core.Instance)"><!-- --></A><H3>minimalExtension</H3><PRE>public static double <B>minimalExtension</B>(<A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;instances,                                      <A HREF="../../../../weka/core/Instance.html" title="class in weka.core">Instance</A>&nbsp;instance)</PRE><DL><DD>Computes the minimal extension for a given instance.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>instances</CODE> - the set of instances<DD><CODE>instance</CODE> - the instance for which the minimal extension is to be calculated<DT><B>Returns:</B><DD>the value of the minimal extension, in internal floating point format</DL></DD></DL><HR><A NAME="minimalExtension(weka.core.Instances, weka.core.Instance, double)"><!-- --></A><H3>minimalExtension</H3><PRE>public static double <B>minimalExtension</B>(<A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;instances,                                      <A HREF="../../../../weka/core/Instance.html" title="class in weka.core">Instance</A>&nbsp;instance,                                      double&nbsp;minValue)</PRE><DL><DD>Computes the minimal extension of a given instance, but the  minimal value returned is <code> minValue. </code>  This method may have its applications when the training set is divided into multiple Instances objects.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>instances</CODE> - the set of instances<DD><CODE>instance</CODE> - the instance for which the minimal extension is to  be calculated<DD><CODE>minValue</CODE> - a double indicating the minimal value that should  be returned<DT><B>Returns:</B><DD>the label of the minimal extension, in internal floating point format</DL></DD></DL><HR><A NAME="maximalExtension(weka.core.Instances, weka.core.Instance)"><!-- --></A><H3>maximalExtension</H3><PRE>public static double <B>maximalExtension</B>(<A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;instances,                                      <A HREF="../../../../weka/core/Instance.html" title="class in weka.core">Instance</A>&nbsp;instance)</PRE><DL><DD>Computes the maximal extension for a given instance.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>instances</CODE> - the set of instances<DD><CODE>instance</CODE> - the instance for which the minimal extension is to be calculated<DT><B>Returns:</B><DD>the value of the minimal extension, in internal floating point format</DL></DD></DL><HR><A NAME="maximalExtension(weka.core.Instances, weka.core.Instance, double)"><!-- --></A><H3>maximalExtension</H3><PRE>public static double <B>maximalExtension</B>(<A HREF="../../../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;instances,                                      <A HREF="../../../../weka/core/Instance.html" title="class in weka.core">Instance</A>&nbsp;instance,                                      double&nbsp;maxValue)</PRE><DL><DD>Computes the maximal extension of a given instance, but the  maximal value returned is <code> maxValue. </code>  This method may have its applications when the training set is divided into multiple Instances objects.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>instances</CODE> - the set of instances<DD><CODE>instance</CODE> - the instance for which the maximal extension is to  be calculated<DD><CODE>maxValue</CODE> - a double indicating the maximal value that should  be returned<DT><B>Returns:</B><DD>the value of the minimal extension, in internal floating point format</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <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> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="http://www.cs.waikato.ac.nz/ml/weka/" target="_blank"><FONT CLASS="NavBarFont1"><B>Weka's home</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/classifiers/misc/monotone/InstancesComparator.html" title="class in weka.classifiers.misc.monotone"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../../weka/classifiers/misc/monotone/MultiDimensionalSort.html" title="class in weka.classifiers.misc.monotone"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../index.html?weka/classifiers/misc/monotone/InstancesUtil.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="InstancesUtil.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&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><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR></BODY></HTML>

⌨️ 快捷键说明

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