Difference between revisions of "Unsupervised Learning"
| Line 8: | Line 8: | ||
:: <math> \text{Pr}\left [\, \bigcap^p_{j=1} (X_j \in s_j) \right ] </math> | :: <math> \text{Pr}\left [\, \bigcap^p_{j=1} (X_j \in s_j) \right ] </math> | ||
| − | + | ====Market Basket Analysis==== | |
Assume all subsets are either <math>s_j</math> consists of exactly one value of <math>X_j</math> or it's the entire set of possible <math>X_j</math> values, <math>s_j = \mathcal{S}_j</math>. Usually dummy variables are used such that the number of dummies is | Assume all subsets are either <math>s_j</math> consists of exactly one value of <math>X_j</math> or it's the entire set of possible <math>X_j</math> values, <math>s_j = \mathcal{S}_j</math>. Usually dummy variables are used such that the number of dummies is | ||
:: <math>K=\displaystyle\sum^p_{j=1}|\mathcal{S_j}|</math> | :: <math>K=\displaystyle\sum^p_{j=1}|\mathcal{S_j}|</math> | ||
| Line 19: | Line 19: | ||
<math>z_{ik}</math> is the ith case of <math>Z_k</math> and is called the "support" or "prevalence" of the item set <math>\mathcal{K}</math>, denoted <math>T(\mathcal{K})</math>. | <math>z_{ik}</math> is the ith case of <math>Z_k</math> and is called the "support" or "prevalence" of the item set <math>\mathcal{K}</math>, denoted <math>T(\mathcal{K})</math>. | ||
Association rule mining entails specifying a lower support bound <math>t</math> and finding ''all'' item sets <math>\mathcal{K}_l</math> that can be formed from <math>Z_1,\dots,Z_K</math> with support in the data greater than <math>t</math>: <math>\{\mathcal{K}_l\,|\,T(\mathcal{K}_l) > t\}</math>. | Association rule mining entails specifying a lower support bound <math>t</math> and finding ''all'' item sets <math>\mathcal{K}_l</math> that can be formed from <math>Z_1,\dots,Z_K</math> with support in the data greater than <math>t</math>: <math>\{\mathcal{K}_l\,|\,T(\mathcal{K}_l) > t\}</math>. | ||
| + | |||
| + | ====The Apriori Algorithm==== | ||
| + | There are <math>2^K</math> possible item sets so <math>t</math> must be adjusted to make the problem computationally tractable. The apriori algorithm says that for a given support threshold <math>t</math>, | ||
| + | * The cardinality is relatively small: <math>|\{\mathcal{K}_l\,|\,T(\mathcal{K}_l) > t\}|</math> | ||
| + | * If <math>\mathcal{L}</math> is an item set which is a subset of <math>\mathcal{K}</math> it must have support <math>\gte\mathcal{K}</math> | ||
===Cluster Analysis=== | ===Cluster Analysis=== | ||
Revision as of 16:37, 9 March 2021
Following Hastie et al.
Supervised learning concerns finding a conditional density estimation [math]\displaystyle{ \text{Pr}(Y|X) }[/math]. In unsupervised learning, the goal is to directly infer properties about the joint marginal density of [math]\displaystyle{ \text{Pr}(X) }[/math]:
- [math]\displaystyle{ \text{Pr}(X,Y) = \text{Pr}(Y|X)\cdot \text{Pr}(X) }[/math]
Association Rules
Goal: Find subsets of variable values [math]\displaystyle{ s_1, \dots, s_p }[/math] such that the probability of each of the variables occupying a value within its respective subset is large. (The intersection of subsets is called a conjunctive rule):
- [math]\displaystyle{ \text{Pr}\left [\, \bigcap^p_{j=1} (X_j \in s_j) \right ] }[/math]
Market Basket Analysis
Assume all subsets are either [math]\displaystyle{ s_j }[/math] consists of exactly one value of [math]\displaystyle{ X_j }[/math] or it's the entire set of possible [math]\displaystyle{ X_j }[/math] values, [math]\displaystyle{ s_j = \mathcal{S}_j }[/math]. Usually dummy variables are used such that the number of dummies is
- [math]\displaystyle{ K=\displaystyle\sum^p_{j=1}|\mathcal{S_j}| }[/math]
where [math]\displaystyle{ |\mathcal{S_j}| }[/math] is number of unique [math]\displaystyle{ X_j }[/math] Each of the [math]\displaystyle{ K }[/math] new [math]\displaystyle{ Z }[/math] variables has the value [math]\displaystyle{ Z_k=1 }[/math] or [math]\displaystyle{ 0 }[/math]. This recasts the problem into finding a subset of the integers [math]\displaystyle{ \mathcal{K} \subset \{1,\dots,K\} }[/math] so that
- [math]\displaystyle{ \text{Pr}\left [\,\bigcap_{k\in\mathcal{K}}(Z_k=1)\right ] = \text{Pr} \left [\,\prod_{k\in\mathcal{K}} Z_k = 1 \right ] \implies \widehat{\text{Pr}}\left [\,\prod_{k\in\mathcal{K}}(Z_k=1)\right ] = \dfrac{1}{N}\sum^N_{i=1}\prod_{k\in\mathcal{K}}z_{ik} }[/math]
[math]\displaystyle{ z_{ik} }[/math] is the ith case of [math]\displaystyle{ Z_k }[/math] and is called the "support" or "prevalence" of the item set [math]\displaystyle{ \mathcal{K} }[/math], denoted [math]\displaystyle{ T(\mathcal{K}) }[/math]. Association rule mining entails specifying a lower support bound [math]\displaystyle{ t }[/math] and finding all item sets [math]\displaystyle{ \mathcal{K}_l }[/math] that can be formed from [math]\displaystyle{ Z_1,\dots,Z_K }[/math] with support in the data greater than [math]\displaystyle{ t }[/math]: [math]\displaystyle{ \{\mathcal{K}_l\,|\,T(\mathcal{K}_l) \gt t\} }[/math].
The Apriori Algorithm
There are [math]\displaystyle{ 2^K }[/math] possible item sets so [math]\displaystyle{ t }[/math] must be adjusted to make the problem computationally tractable. The apriori algorithm says that for a given support threshold [math]\displaystyle{ t }[/math],
- The cardinality is relatively small: [math]\displaystyle{ |\{\mathcal{K}_l\,|\,T(\mathcal{K}_l) \gt t\}| }[/math]
- If [math]\displaystyle{ \mathcal{L} }[/math] is an item set which is a subset of [math]\displaystyle{ \mathcal{K} }[/math] it must have support [math]\displaystyle{ \gte\mathcal{K} }[/math]