rulestats.html

来自「由java开发的软件包」· HTML 代码 · 共 1,086 行 · 第 1/3 页

HTML
1,086
字号
</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/classifiers/rules/RuleStats.html#setData(weka.core.Instances)">setData</A></B>(<A HREF="../../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;data)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the data of the stats, overwriting the old one if any</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/classifiers/rules/RuleStats.html#setMDLTheoryWeight(double)">setMDLTheoryWeight</A></B>(double&nbsp;weight)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the weight of theory in MDL calcualtion</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/classifiers/rules/RuleStats.html#setNumAllConds(double)">setNumAllConds</A></B>(double&nbsp;total)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the number of all conditions that could appear  in a rule in this RuleStats object, if the number set is smaller than 0 (typically -1), then it calcualtes based on the data store</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/classifiers/rules/RuleStats.html#setRuleset(weka.core.FastVector)">setRuleset</A></B>(<A HREF="../../../weka/core/FastVector.html" title="class in weka.core">FastVector</A>&nbsp;rules)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the ruleset of the stats, overwriting the old one if any</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../weka/core/Instances.html" title="class in weka.core">Instances</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/rules/RuleStats.html#stratify(weka.core.Instances, int, java.util.Random)">stratify</A></B>(<A HREF="../../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;data,         int&nbsp;folds,         java.util.Random&nbsp;rand)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Stratify the given data into the given number of bags based on the class values.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;double</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/classifiers/rules/RuleStats.html#subsetDL(double, double, double)">subsetDL</A></B>(double&nbsp;t,         double&nbsp;k,         double&nbsp;p)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Subset description length: <br> S(t,k,p) = -k*log2(p)-(n-k)log2(1-p) Details see Quilan: "MDL and categorical theories (Continued)",ML95</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/classifiers/rules/RuleStats.html#theoryDL(int)">theoryDL</A></B>(int&nbsp;index)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The description length of the theory for a given rule.</TD></TR></TABLE>&nbsp;<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, toString, wait, wait, wait</CODE></TD></TR></TABLE>&nbsp;<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="RuleStats()"><!-- --></A><H3>RuleStats</H3><PRE>public <B>RuleStats</B>()</PRE><DL><DD>Default constructor<P></DL><HR><A NAME="RuleStats(weka.core.Instances, weka.core.FastVector)"><!-- --></A><H3>RuleStats</H3><PRE>public <B>RuleStats</B>(<A HREF="../../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;data,                 <A HREF="../../../weka/core/FastVector.html" title="class in weka.core">FastVector</A>&nbsp;rules)</PRE><DL><DD>Constructor that provides ruleset and data<P><DT><B>Parameters:</B><DD><CODE>data</CODE> - the data<DD><CODE>rules</CODE> - the ruleset</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="setNumAllConds(double)"><!-- --></A><H3>setNumAllConds</H3><PRE>public void <B>setNumAllConds</B>(double&nbsp;total)</PRE><DL><DD>Set the number of all conditions that could appear  in a rule in this RuleStats object, if the number set is smaller than 0 (typically -1), then it calcualtes based on the data store<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>total</CODE> - the set number</DL></DD></DL><HR><A NAME="setData(weka.core.Instances)"><!-- --></A><H3>setData</H3><PRE>public void <B>setData</B>(<A HREF="../../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;data)</PRE><DL><DD>Set the data of the stats, overwriting the old one if any<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>data</CODE> - the data to be set</DL></DD></DL><HR><A NAME="getData()"><!-- --></A><H3>getData</H3><PRE>public <A HREF="../../../weka/core/Instances.html" title="class in weka.core">Instances</A> <B>getData</B>()</PRE><DL><DD>Get the data of the stats<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the data</DL></DD></DL><HR><A NAME="setRuleset(weka.core.FastVector)"><!-- --></A><H3>setRuleset</H3><PRE>public void <B>setRuleset</B>(<A HREF="../../../weka/core/FastVector.html" title="class in weka.core">FastVector</A>&nbsp;rules)</PRE><DL><DD>Set the ruleset of the stats, overwriting the old one if any<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>rules</CODE> - the set of rules to be set</DL></DD></DL><HR><A NAME="getRuleset()"><!-- --></A><H3>getRuleset</H3><PRE>public <A HREF="../../../weka/core/FastVector.html" title="class in weka.core">FastVector</A> <B>getRuleset</B>()</PRE><DL><DD>Get the ruleset of the stats<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the set of rules</DL></DD></DL><HR><A NAME="getRulesetSize()"><!-- --></A><H3>getRulesetSize</H3><PRE>public int <B>getRulesetSize</B>()</PRE><DL><DD>Get the size of the ruleset in the stats<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the size of ruleset</DL></DD></DL><HR><A NAME="getSimpleStats(int)"><!-- --></A><H3>getSimpleStats</H3><PRE>public double[] <B>getSimpleStats</B>(int&nbsp;index)</PRE><DL><DD>Get the simple stats of one rule, including 6 parameters: 0: coverage; 1:uncoverage; 2: true positive; 3: true negatives; 4: false positives; 5: false negatives<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the index of the rule<DT><B>Returns:</B><DD>the stats</DL></DD></DL><HR><A NAME="getFiltered(int)"><!-- --></A><H3>getFiltered</H3><PRE>public <A HREF="../../../weka/core/Instances.html" title="class in weka.core">Instances</A>[] <B>getFiltered</B>(int&nbsp;index)</PRE><DL><DD>Get the data after filtering the given rule<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the index of the rule<DT><B>Returns:</B><DD>the data covered and uncovered by the rule</DL></DD></DL><HR><A NAME="getDistributions(int)"><!-- --></A><H3>getDistributions</H3><PRE>public double[] <B>getDistributions</B>(int&nbsp;index)</PRE><DL><DD>Get the class distribution predicted by the rule in given position<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the position index of the rule<DT><B>Returns:</B><DD>the class distributions</DL></DD></DL><HR><A NAME="setMDLTheoryWeight(double)"><!-- --></A><H3>setMDLTheoryWeight</H3><PRE>public void <B>setMDLTheoryWeight</B>(double&nbsp;weight)</PRE><DL><DD>Set the weight of theory in MDL calcualtion<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>weight</CODE> - the weight to be set</DL></DD></DL><HR><A NAME="numAllConditions(weka.core.Instances)"><!-- --></A><H3>numAllConditions</H3><PRE>public static double <B>numAllConditions</B>(<A HREF="../../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;data)</PRE><DL><DD>Compute the number of all possible conditions that could  appear in a rule of a given data.  For nominal attributes, it's the number of values that could appear; for numeric  attributes, it's the number of values * 2, i.e. <= and >= are counted as different possible conditions.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>data</CODE> - the given data<DT><B>Returns:</B><DD>number of all conditions of the data</DL></DD></DL><HR><A NAME="countData()"><!-- --></A><H3>countData</H3><PRE>public void <B>countData</B>()</PRE><DL><DD>Filter the data according to the ruleset and compute the basic stats: coverage/uncoverage, true/false positive/negatives of  each rule<P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="countData(int, weka.core.Instances, double[][])"><!-- --></A><H3>countData</H3><PRE>public void <B>countData</B>(int&nbsp;index,                      <A HREF="../../../weka/core/Instances.html" title="class in weka.core">Instances</A>&nbsp;uncovered,                      double[][]&nbsp;prevRuleStats)</PRE><DL><DD>Count data from the position index in the ruleset assuming that given data are not covered by the rules in position 0...(index-1), and the statistics of these rules are provided.<br> This procedure is typically useful when a temporary  object of RuleStats is constructed in order to efficiently calculate the relative DL of rule in position index,  thus all other stuff is not needed.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the given position<DD><CODE>uncovered</CODE> - the data not covered by rules before index<DD><CODE>prevRuleStats</CODE> - the provided stats of previous rules</DL></DD></DL><HR><A NAME="addAndUpdate(weka.classifiers.rules.Rule)"><!-- --></A><H3>addAndUpdate</H3>

⌨️ 快捷键说明

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