📄 tidlists-class.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Class “tidLists” — Transaction ID Lists for Items/Itemsets</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 tidLists-class {arules}"><tr><td>tidLists-class {arules}</td><td align="right">R Documentation</td></tr></table>
<h2>Class “tidLists” — Transaction ID Lists for Items/Itemsets</h2>
<h3>Description</h3>
<p>
Transaction ID lists contains a set of lists. Each list is associated with
an item/itemset and stores the IDs of the transactions which support the
item/itemset. <code>tidLists</code> uses the class
<code><a href="../../Matrix/html/ngCMatrix-class.html">ngCMatrix</a></code> to efficiently store the
transaction ID lists as a sparse matrix. Each column in the matrix
represents one transaction ID list.
</p>
<p>
<code>tidLists</code> can be used for different purposes. For some operations
(e.g., support counting) it is efficient to coerce a
<code><a href="transactions-class.html">transactions</a></code> database into <code>tidLists</code> where each
list contains the transaction IDs for an item (and the support is given by
the length of the list).
</p>
<p>
The implementation of the Eclat mining algorithm (which uses transaction ID
list intersection) can also produce transaction ID lists for the found
itemsets as part of the returned <code><a href="itemsets-class.html">itemsets</a></code> object. These
lists can then be used for further computation.
</p>
<h3>Objects from the Class</h3>
<p>
Objects are created by Eclat if the <code><a href="eclat.html">eclat</a></code> function is called
with <code>tidLists = TRUE</code> in the <code><a href="ASparameter-class.html">ECparameter</a></code> object,
and returned as part of the mined <code><a href="itemsets-class.html">itemsets</a></code>. Objects can
also be created by coercion from an object of class
<code><a href="transactions-class.html">transactions</a></code> or by calls of the form
<code>new("tidLists", ...)</code>.
</p>
<h3>Slots</h3>
<dl>
<dt><code>data</code>:</dt><dd>object of class
<code><a href="../../Matrix/html/ngCMatrix-class.html">ngCMatrix</a></code>.</dd>
<dt><code>itemInfo</code>:</dt><dd>a data.frame to store item/itemset labels (see
<code><a href="itemMatrix-class.html">itemMatrix</a></code> class).</dd>
<dt><code>transactionInfo</code>:</dt><dd>a data.frame
with vectors of the same length as the number of transactions.
Each vector can hold additional information e.g., store
transaction IDs or user IDs for each transaction.</dd>
</dl>
<h3>Methods</h3>
<dl>
<dt>coerce</dt><dd><code>signature(from = "tidLists", to = "ngCMatrix")</code>;
access the sparse matrix representation. In the
<code>ngCMatrix</code> each column represents the transaction IDs
for one item/itemset.</dd>
<dt>coerce</dt><dd><code>signature(from = "tidLists", to = "dgCMatrix")</code></dd>
<dt>coerce</dt><dd><code>signature(from = "tidLists", to = "list")</code></dd>
<dt>coerce</dt><dd><code>signature(from = "tidLists", to = "matrix")</code></dd>
<dt>coerce</dt><dd><code>signature(from = "tidLists", to = "itemMatrix")</code></dd>
<dt>coerce</dt><dd><code>signature(from = "tidLists", to = "transactions")</code></dd>
<dt>coerce</dt><dd><code>signature(from = "itemMatrix", to = "tidLists")</code></dd>
<dt>coerce</dt><dd><code>signature(from = "transactions", to = "tidLists")</code></dd>
<dt>dim</dt><dd><code>signature(x = "tidLists")</code>;
returns the dimensions of the sparse Matrix representing the
<code>tidLists</code>.</dd>
<dt>itemInfo</dt><dd>returns the slot <code>itemInfo</code>.</dd>
<dt>itemLabels</dt><dd><code>signature(object = "tidLists")</code>;
returns the item labels as a character vector.</dd>
<dt>labels</dt><dd><code>signature(x = "transactions")</code>;
returns the labels (item labels and transaction IDs)
for the incidence matrix as a list of two vectors named <code>items</code>
and <code>transactionID</code>.</dd>
<dt>show</dt><dd><code>signature(object = "tidLists")</code></dd>
<dt>summary</dt><dd><code>signature(object = "tidLists")</code></dd>
<dt>transactionInfo</dt><dd><code>signature(x = "transactions")</code>:
returns the slot <code>transactionInfo</code>.</dd>
</dl>
<h3>See Also</h3>
<p>
<code><a href="Xtrct-methods.html">[-methods</a></code>,
<code><a href="LIST.html">LIST</a></code>,
<code><a href="eclat.html">eclat</a></code>,
<code><a href="image.html">image</a></code>,
<code><a href="length.html">length</a></code>,
<code><a href="size.html">size</a></code>,
<code><a href="../../Matrix/html/ngCMatrix.html">ngCMatrix</a></code> (in <span class="pkg">Matrix</span>),
<code><a href="itemMatrix-class.html">itemMatrix-class</a></code>,
<code><a href="itemsets-class.html">itemsets-class</a></code>,
<code><a href="transactions-class.html">transactions-class</a></code>
</p>
<h3>Examples</h3>
<pre>
## Create transaction data set.
data <- list(
c("a","b","c"),
c("a","b"),
c("a","b","d"),
c("b","e"),
c("b","c","e"),
c("a","d","e"),
c("a","c"),
c("a","b","d"),
c("c","e"),
c("a","b","d","e")
)
t <- as(data, "transactions")
## Mine itemsets with tidLists.
f <- eclat(data, parameter = list(support = 0, tidLists = TRUE))
## Get dimensions of the tidLists.
dim(tidLists(f))
## Coerce tidLists to list.
as(tidLists(f), "list")
## Inspect visually.
image(tidLists(f))
</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 + -