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

📄 rules-class.html

📁 本程序是基于linux系统下c++代码
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Class &ldquo;rules&rdquo; &mdash; A Set of Rules</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../R.css">
</head><body>

<table width="100%" summary="page for rules-class {arules}"><tr><td>rules-class {arules}</td><td align="right">R Documentation</td></tr></table>
<h2>Class &ldquo;rules&rdquo; &mdash; A Set of Rules</h2>


<h3>Description</h3>

<p>
The <code>rules</code> class represents a set of rules.
</p>
<p>
Note that the class can also represent a multiset of rules with duplicated
elements. Duplicated elements can be removed with <code><a href="unique.html">unique</a></code>.
</p>


<h3>Objects from the Class</h3>

<p>
Objects are the result of calling the function <code><a href="apriori.html">apriori</a></code>.
Objects can also be created by calls of the form
<code>new("rules", ...)</code>.
</p>


<h3>Slots</h3>

<dl>
<dt><code>lhs</code>:</dt><dd>Object of class
<code><a href="itemMatrix-class.html">itemMatrix</a></code>; 
the left-hand-sides of the rules (antecedents)</dd>
<dt><code>rhs</code>:</dt><dd>Object of class
<code><a href="itemMatrix-class.html">itemMatrix</a></code>;
the right-hand-sides of the rules (consequents)</dd> 
<dt><code>quality</code>:</dt><dd>a data.frame</dd>
</dl>

<h3>Extends</h3>

<p>
Class <code><a href="associations-class.html">associations</a></code>, directly.
</p>


<h3>Methods</h3>

<dl>
<dt>coerce</dt><dd><code>signature(from = "rules", to = "data.frame")</code>; 
represents the set of rules as a <code>data.frame</code></dd>
<dt>itemInfo</dt><dd><code>signature(object = "rules")</code>;  
returns the whole item information data frame including item
labels</dd>
<dt>itemLabels</dt><dd><code>signature(object = "rules")</code>;
returns the item labels used to encode the rules</dd>
<dt>items</dt><dd><code>signature(x = "rules")</code>;
returns for each rule the union of the items in the 
lhs and rhs (i.e., the itemsets
which generated the rule) as an 
<code><a href="itemMatrix-class.html">itemMatrix</a></code></dd>
<dt>generatingItemsets</dt><dd><code>signature(x = "rules")</code>;
returns a collection of the itemsets which generated the rules (one 
itemset for each rule). Note that the collection can be a multiset and 
contain duplicated
elements. Use <code>unique</code> to remove duplicates and obtain a 
proper set.</dd>  
<dt>labels</dt><dd><code>signature(object = "rules")</code>;
returns labels for the rules ("{lhs} =&gt; {rhs}") as a
<code>character</code> vector. The representation can be customized using 
the additional parameter <code>ruleSep</code> and parameters for <code>label</code>
defined in <code><a href="itemMatrix-class.html">itemMatrix</a></code></dd> 
<dt>itemLabels</dt><dd><code>signature(object = "rules")</code>;
returns the item labels as a character vector.
The index for each lable is the column index of the item in the
binary matrix.</dd>
<dt>lhs</dt><dd><code>signature(x = "rules")</code>;
returns the <code><a href="itemMatrix-class.html">itemMatrix</a></code>
representing the left-hand-side of the rules (antecedents)</dd>
<dt>lhs&lt;-</dt><dd><code>signature(x = "rules")</code>;
replaces the <code><a href="itemMatrix-class.html">itemMatrix</a></code>
representing the left-hand-side of the rules (antecedents)</dd>
<dt>rhs</dt><dd><code>signature(x = "rules")</code>;
returns the <code><a href="itemMatrix-class.html">itemMatrix</a></code>
representing the right-hand-side of the rules (consequents)</dd>
<dt>rhs&lt;-</dt><dd><code>signature(x = "rules")</code>;
replaces the <code><a href="itemMatrix-class.html">itemMatrix</a></code>
representing the right-hand-side of the rules (consequents)</dd>
<dt>summary</dt><dd><code>signature(object = "rules")</code></dd>
</dl>

<h3>See Also</h3>

<p>
<code><a href="Xtrct-methods.html">[-methods</a></code>,
<code><a href="apriori.html">apriori</a></code>,
<code><a href="combine.html">c</a></code>,
<code><a href="duplicated.html">duplicated</a></code>,
<code><a href="inspect.html">inspect</a></code>,
<code><a href="length.html">length</a></code>,
<code><a href="match.html">match</a></code>,
<code><a href="sets.html">sets</a></code>,
<code><a href="size.html">size</a></code>,
<code><a href="subset.html">subset</a></code>,
<code><a href="associations-class.html">associations-class</a></code>,
<code><a href="itemMatrix-class.html">itemMatrix-class</a></code>,
</p>


<h3>Examples</h3>

<pre>
data("Adult")

## Mine rules.
rules &lt;- apriori(Adult, parameter = list(support = 0.4))

## Select a subset of rules using partial matching on the items 
## in the right-hand-side and a quality measure
rules.sub &lt;- subset(rules, subset = rhs %pin% "sex" &amp; lift &gt; 1.3)

## Display rules.
inspect(SORT(rules.sub)[1:3])
</pre>



<hr><div align="center">[Package <em>arules</em> version 0.6-6 <a href="00Index.html">Index]</a></div>

</body></html>

⌨️ 快捷键说明

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