1. Basic Concepts
โ Overview
โข Motivation : finding inherent regularities in data
โช ํจ๊ป ๊ตฌ๋งค๋๋ ์ํ์ด ๋ฌด์์ด ์์๊น
โช PC ๋ฅผ ์ฌ๊ณ ๋ ์งํ์ ๊ตฌ๋งคํ๋ ์ํ์ ๋ญ๊ฐ ์์๊น
โช ์๋ก์ด ์ฝ์ ๋ฏผ๊ฐํ DNA๋ ์ด๋ค ์ข ๋ฅ๊ฐ ์์๊น
โช ์น๋ฌธ์๋ฅผ ์๋์ผ๋ก ๋ถ๋ฅํ ์ ์์๊น
โจ ์ฐ๊ด๋ ๊ท์น์ ์ฐพ์๋ณด์
โข Application
โช Basket data analysis, cross-marketing, catalog design, sale campaign analysis, Web log (click stream) analysis, and DNA sequence analysis

โก Association Rule Mining
โข Given a set of transactions, we find rules that will predict the occurrence of an item based on the occurrences of other items in the transaction

โข Definition
A. Frequent Itemset
โช Itemset : collection of one or more items : {Milk, Bread, Diaper}
โช k-itemset : An itemset that contains k items
โช Support count (ฯ) or absolute support

โช (Relative) support : Fraction of transactions that contain an itemset

โช Frequent Itemset : An itemset whose support is greater than or equal to a minsup threshold
B. Association Rule
โช Association Rule : An implication expression of the form XโY, where X and Y are itemsets

โช Support (s) : Fraction of transactions that contain both X and Y
โช Confidence (c) : Measures how often items in Y appear in transactions that contain X

โฃ Association Rule Mining Task
โข Given a set of transactions T, the goal of association rule mining is to find all rules such that

โข Brute-force approach
- ๋ชจ๋ ์ฐ๊ด๊ท์น์ ๋์ดํ๋ค
- ๊ฐ ๊ท์น์ ๋ํด support ์ confidence ๋ฅผ ๊ณ์ฐํ๋ค.
- minsup ๊ณผ minconf ๋ฅผ ๋์ง ์๋ ๊ท์น์ ์ ๊ฑฐํ๋ค. (prune)
โจ ๊ณ์ฐ๋์ด ๋งค์ฐ ๋ง๋ค!
โค Mining Association Rules
โข Examples and observations

โช ์์ ๋ชจ๋ ๊ท์น์ {Milk, Diaper, Beer} ์ binary partition ์ ์กฐํฉ์ด๋ค.
โช ๊ฐ์ itemset ์ผ๋ก๋ถํฐ ๋ฐ์๋ ๊ท์น๋ค์ ๋์ผํ support ๊ฐ์ ๊ฐ์ง๊ณ ์์ง๋ง, confidence ๊ฐ์ ๋ค๋ฅด๋ค.
โช ๋ฐ๋ผ์ support ์ confidence ์ ์๊ตฌ์ฌํญ์ ๋ถ๋ฆฌํด๋ณผ ์ ์๋ค.
โช ๋น๋ฒํ์ง ์์ item set ์ ์ฐ๊ด๊ท์น์์ ์ฐพ์๋ณผ ์ ์๋ค. ๋น๋ฐํ์ง ์์ itemset ์ partition ์ ํด๋นํ๋ ๊ท์น์ minsup ์ ๋ง์กฑ์ํฌ ์ ์๋ค โจ support ์ confidence ์ ์กฐ๊ฑด์ ๋ถ๋ฆฌ์์ผ์ ๋ด์ผ ํ๋ค.
โข Steps
1. Frequent itenset generation ๋น๋ฐ์งํฉํญ๋ชฉ ์์ฑ
โธ Generating all itemsets whose support โฅ minsup
โธ ์ฌ์ ํ ๊ณ์ฐ์ ์ผ๋ก ๋น์ฉ์ด ๋๊ธด ํจ
2. Rule generation
โธ ๊ฐ ๋น๋ฐํญ๋ชฉ ์งํฉ์์ high confidence rule ์์ฑ, ์ฌ๊ธฐ์ ๊ฐ ๊ท์น์ ๋น๋ฐ ํญ๋ชฉ์งํฉ์ ์ด์ง๋ถํ
โธ 1๋ฒ์์ minsup ์ ํ์ธํ์ผ๋, ์ด ๋จ๊ณ์์๋ minconf ๋ง ํ์ธํ๋ฉด ๋จ
2. Frequent itemset mining methods
โ Introduce
โข Candidate Itemsets : 2^d ๋งํผ์ ํ๋ณด itemset ๋ค์ ๊ณ ๋ คํด๋ณผ ์ ์์, d๋ transaction ์ ๋ฑ์ฅํ ๊ณ ์ ํ ์์ดํ ์๋ฅผ ์๋ฏธํจ

โข Brute-force approach
โช Each itemset in the lattice is a candidate frequent itemset
โช We count the support of each candidate by scanning the database

โช ๋ชจ๋ ํ๋ณด์ ๊ฐ transaction ๋ค์ ๋งค์นํด๋ณด์์ผ ํจ
โช Complexity ~ O(NMw) โจ Expensive since M = 2^d !! ๊ณ์ฐ๋ณต์ก๋๊ฐ ๋งค์ฐ ํผ
โข Computational complexity
โช d unique items ์ด ์์ ๋, ๊ฐ๋ฅํ ์ด itemset ์ 2^d ๊ฐ์ด๋ค.
โช ์ด๋ ๊ฐ๋ฅํ ์ด association rule ๋ค์ R ๊ฐ๊ฐ ๊ฐ๋ฅํ๋ค.

โข Possible Improvements
a. Reducing the # of candidates (M)
โจ Complete search: M=2^d
โจ Using pruning techniques to reduce M : apriori ์๊ณ ๋ฆฌ์ฆ
b. Reducing the number of transactions (N)
โจ Reducing size of N as the size of itemset increases
โจ Being used by DHP and vertical-based mining algorithms (์์ ์์๋ ๋ค๋ฃจ์ง ์์)
c. Reducing the number of comparisons (NM)
โจ Using efficient data structures (e.g., hash tables) to store the candidates or transactions
โจ No need to match every candidate against every transaction : FP-growth ์๊ณ ๋ฆฌ์ฆ
โก Apriori
Candidate ๊ฐ์๋ฅผ ์ค์ด๋ ๋ฐฉ๋ฒ!
โข Apriori principle or downward closure property
โจ If an itemset is frequent, then all of its subsets must also be frequent
: ํญ๋ชฉ์งํฉ์ด ๋น๋ฐํ๊ฒ ์๋ ๊ฒฝ์ฐ, ํญ๋ชฉ์งํฉ์ ๋ชจ๋ ๋ถ๋ถ์งํฉ๋ ๋น๋ฐํด์ผ ํ๋ค.
โจ anti-monotone property of support : Support of an itemset never exceeds the support of its subsets


โข Example

โช 1-itemset ์์ minsup ์ ๋ง์กฑํ์ง ์๋ Coke ์ Eggs ๋ ์ ์ธํ๋ค.
โช coke ์ eggs ๋ฅผ ์ ์ธํ์ฌ ์กฐํฉํด ๋ง๋ 2-itemset ์์ ์ญ์ minsup ์ ๋ง์กฑํ์ง ์๋ ์กฐํฉ์ ์ ์ธํ๋ค.
โช 3-itemset ์กฐํฉ ... (์๋ก์ด ๋น๋ฐ์งํฉ์ ์ฐพ์ ๋๊น์ง ๋ฐ๋ณต)
โจ ์ด๋ก์จ ๊ฐ๋ฅํ ํ๋ณด๋ค์ ์ค์ผ ์ ์๋ค.
โข Algorithm Pseudo code
์ ์ฒด์ฝ๋

๋ถ๋ถ์ ์ผ๋ก ์ดํด๋ณด์ !

โช Lk : frequent k-itemsets
โช Ck : candidate k-itemsets
โช Ct : transaction t ์์์ candidate
โจ Ck = apriori-gen(L_k-1)
โจ Lk = {c | c.count โฅ minsup}
โจ Ct = subset(Ck,t)
โข Candidate Genration (apriori-gen)

โช 1. L_k-1 ์์ self-joining ๊ณผ์ ์ ์ํ
โช 2. Pruning

โช ์๋ฅผ๋ค์ด, L3 = {abc,abd,acd,ace,bcd} ๊ธธ์ด๊ฐ 3์ธ ๋น๋ฐ์งํฉ์ด๋ผ๊ณ ํ์ ๋, L3 ์ self joining ๊ฒฐ๊ณผ๋ก C4 ๊ธธ์ด๊ฐ 4์ธ ํ๋ณด์งํฉ์ ์์ฑํ๋ค๊ณ ๊ฐ์ ํด๋ณด์. ์ด๋ self joining ์ ํ๋ ค๋ฉด, ์ต์ 2๊ฐ์ item ์ด ๊ฒน์ณ์ผ joining ์ด ๊ฐ๋ฅํ๋ค. ๊ฐ๊ฐ์ ์กฐํฉ์ผ๋ก ์์ฑ๋ ๊ฒ๋ค ์ค์, abc ์ abd ์ ์กฐํฉ์ผ๋ก abcd ๋ฅผ ๋ง๋ค์๊ณ , acd์ ace์ ์กฐํฉ์ผ๋ก acde ๋ฅผ ๋ง๋ค์๋ค๊ณ ํด๋ณด์. ์ฌ๊ธฐ์ abcd ์ ๊ฒฝ์ฐ, abc, abd, acd, bcd ๊ฐ L3 ์ ๋ชจ๋ ํฌํจ๋์ด ์๋ค. ๊ทธ๋ฌ๋ acde ์ ๊ฒฝ์ฐ, acd,ace ๋ L3 ์ ํฌํจ๋์ด ์์ง๋ง, ade, cde ๋ ํฌํจ๋์ง ์๊ธฐ ๋๋ฌธ์ anti-monotone ์ฑ์ง์ ์๋ฐฐ๋์ด, acde ๋ C4 ํ๋ณด์์ ์ ์ธํ ์๋ฐ์ ์๋ค.

โช ๋ค์ ์ ํํ ์ดํด๋ฅผ ์ํด ์ค๋ช ํด๋ณด์๋ฉด, L2 ๋ก๋ถํฐ C3 ํ๋ณด์งํฉ์ ๋์ถํด๋ผ ๋, {ABC} ์ ๊ฒฝ์ฐ {AB} ์ ์กฐํฉ์ด L2์ ์๊ธฐ ๋๋ฌธ์ ์ ์ธ, {ABE}์ ๊ฒฝ์ฐ {AE} ์กฐํฉ์ด ์๊ธฐ ๋๋ฌธ์ ์ ์ธ, {ACE} ์ ๊ฒฝ์ฐ๋ {AE} ๊ฐ ์๊ธฐ ๋๋ฌธ์ ์ ์ธํ๋ค. {BCE} ๊ฐ์ ๊ฒฝ์ฐ๋ {BC},{BE},{CE} ๊ฐ ๋ชจ๋ L2 ์ ๋น๋ฐ์งํฉ์ผ๋ก ์กด์ฌํ๊ธฐ ๋๋ฌธ์ ๊ฐ๋ฅํ๋ค.

โช ์ฌ๊ธฐ์๋ L2์์ C3 ํ๋ณด์งํฉ์ ์์ฑํ ๋ ์ค๋ช ์ ์ฐธ๊ณ ํด๋ณด์!
โช ์๋ฌดํผ ์ด๋ฐ์์ผ๋ก ๋น๋ฐ์งํฉ L ๋ค์ ์ฐพ์๊ฐ๋ฉด ๋๋ค.
โข Reducing # of comparisons
๋น๊ต ๊ฐ์๋ฅผ ์ค์ด๋ ๋ฐฉ๋ฒ
โข support counting : ํธ๋์ ์ ์ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์ดํด๋ณด๋ ๊ฒ์ ๊ฐ ํ๋ณด์งํฉ์ support ๋ฅผ ๊ฒฐ์ ํ๋ค. ๋น๊ตํ์๋ฅผ ์ค์ด๊ธฐ ์ํด์, ํ๋ณด์งํฉ๋ค์ ํด์๊ตฌ์กฐ hash structure ๋ก ์ ์ฅํ๋ค. ๋ชจ๋ ํ๋ณด์งํฉ์ ๋ํด ๊ฐ๊ฐ์ ํธ๋์ ์ ์ ๋น๊ตํ ํ์ ์์ด, ํน์ ํ๋ณด์งํฉ์ ํฌํจํ๋ hased buckets ๊ณผ๋ง ๋น๊ตํ๋ฉด ๋๋ค.

โข Generating hash tree
๊ธธ์ด๊ฐ 3์ธ 15๊ฐ์ ํ๋ณด์งํฉ๋ค์ด ์๋ค๊ณ ๊ฐ์ ํด๋ณด์

ํด์ํจ์๊ฐ ์๋ ๊ทธ๋ฆผ๊ณผ ๊ฐ์ด ์ฃผ์ด์ง๊ณ , ๋ฆฌํ๋ ธ๋์ ์ ์ฅํ ์ ์๋ ์ต๋ ์์ดํ ์งํฉ์ ์์ธ Max leaf size ๋ฅผ ๊ฒฐ์ ํด์ค๋ค. ํ๋ณด ์์ดํ ์งํฉ์ ์๊ฐ max size ๋ฅผ ๋์ด๊ฐ๋ค๋ฉด ๋ ธ๋๋ฅผ ์๋๋ก ์ชผ๊ฐ ๋ค.

ํต์ฌ์ ํด์ํธ๋ฆฌ์ i ๋ฒ์งธ level ์์๋ i๋ฒ์งธ item ์ ํ์ธํด ํด์ํจ์ ๊ท์น์ ๋ง๊ฒ ํ๋ณด ์์ดํ ์ ์ ๋ฐฐ์ ํ๋ ๊ฒ์ด๋ค.

์๋ฅผ๋ค์ด {145} itemset ๋ฅผ ํ ๋นํ๋ค๊ณ ํ๋ฉด, ์ฒซ๋ฒ์งธ level ์์ ์ฒซ๋ฒ์งธ item ์ ๊ณ ๋ คํด ํ ๋นํ๋ฏ๋ก 1์ (1,4,7) ์ค์ ํฌํจ๋์ด ์๊ธฐ ๋๋ฌธ์ ๊ฐ์ฅ ์ผ์ชฝ ๊ฐ์ง ํ์๋ก ์์๊ฐ ๋ฐฐ์ ๋๋ค. ๋ ธ๋ ์๋๋ก ๋ฐฐ์ ๋๋ ์์ดํ ์ ์ด 3๊ฐ๊ฐ ์ด๊ณผ๋๋ฉด ๊ณ์ ํ์ ๋ ธ๋๋ค์ ์์ฑํด ๋ฐฐ์ ์ ์งํํ๋ฉด ๋๋ค.


โข Subset operation using the hash tree
ํด์ํธ๋ฆฌ๋ฅผ ์ฌ์ฉํ๋ ์ด์ ๋ subset operation ์ ํจ์จ์ ์ผ๋ก ํ๊ธฐ ์ํจ์ด๋ค.
ํธ๋์ ์ t๋ฅผ ํฌํจํ๋ ๋ชจ๋ ๊ฐ๋ฅํ ํ๋ณด์งํฉ๋ค์ ์ฐพ๊ณ ์ถ๋ค.
ํธ๋์ ์ t๊ฐ ์ฃผ์ด์ก์ ๋, ๊ฐ๋ฅํ ํฌ๊ธฐ๊ฐ 3์ธ subset ๋ค์ ๊ณ์ฐํ๋ ๊ณผ์ ์ ์๋์ ๊ฐ๋ค.

์ด๋ ํธ๋์ ์ t์์, ํด์ํธ๋ฆฌ๋ฅผ ์ฌ์ฉํ์ฌ candidates ๋ค๊ณผ ๋น๊ตํด ๋น๋ฐ์งํฉ์ ์ฐพ์๊ฐ๋ ๊ณผ์ ์ ๊ทธ๋ฆฌ๋ฉด ๋ค์๊ณผ ๊ฐ๋ค.

๋ ธ๋์์ ์ฐ๋ฆฌ๊ฐ ํด์ํจ์๋ฅผ ํตํด ํ ๋นํด๋์ candidate ๋ค์ด๊ณ , ๋ฏผํธ์์ transaction ์์ ํ์๋ ์์ดํ ์งํฉ๋ค์ด๋ผ ๋ณผ ์ ์๋ค. ํด์ํธ๋ฆฌ๋ฅผ ์ฌ์ฉํด์ ๋น๋ฐ์งํฉ์ ์ฐพ์๋ณด์.

subset operation ์ฒ๋ผ prefix ๋ฅผ ๊ณ ์ ํ๊ณ ๊ฐ๋ฅํ ์กฐํฉ๋ค์ hash ํจ์์ ๋ฐ๋ผ ํ ๋นํด๋ณด๋ฉด ๋ค์๊ณผ ๊ฐ๋ค. ํํฌ์๊ณผ ํ๋์ ํ์ดํ๋ค์ด ๊ฐ๋ฆฌํค๊ณ ์๋ ๋ ธ๋์ ํ๋ณด๊ตฐ์ด ์์นํ ์ ์๋ค.

cadidate ๋ค๊ณผ transaction ์์ ์์ฑ๋๋ itemset ๋ค์ ๋น๊ตํด๋ณด๋ฉฐ support ๋ฅผ ๊ณ์ฐํด ๋น๋ฐ์งํฉ๋ค์ ์ฐพ์๋ด๊ฐ๋ค. ์ด๋ ์ ํ๋์ง ์์ ๋ฆฌํ๋ ธ๋๋ค ๊ฐ์ ๊ฒฝ์ฐ์ ํธ๋์ ์ ์ ํฌํจ๋์ง ์๋ subset ์ด๋ผ๊ณ ์๊ฐํ๋ฉด ๋๋ค.
์ฌ๊ธฐ์ 458 ์ ํธ๋์ ์ ์ ํฌํจ๋์ง ์์ ํ์๋ฅผ ๋ํ์ง ์์ง๋ง ์ด์จ๋ ์ ์ฒด ํจ์๊ฐ ํธ๋์ ์ ์ subset ๋ค์ ์ ์ฉ์ ๋๊ธฐ ๋๋ฌธ์ count๋ฅผ ํด์ฃผ๊ธด ํด์ค๋ค!
๊ทธ๋์ ์ต์ข ์ ์ผ๋ก 15๊ฐ์ ํ๋ณด๋ค ์ค์ 9๊ฐ๊ฐ ํธ๋์ ์ ๊ณผ ๋งค์นญ์ด ๋๊ณ , ์ฐ๋ฆฌ๋ 9๊ฐ์ ํ๋ณด ์์ดํ ์ ์ค์ 5๊ฐ์ ๋ฆฌํ๋ ธ๋์ ๋ํด support ๋ฅผ ๊ฒ์ฐํด๋ธ๋ค.
โข Apriori ์ Complexity ์ ์ํฅ์ ๋ฏธ์น๋ ์์๋ค
a. Choice of minimum support threshold : ๋ฎ์ minsup ์ ๊ณ ๋ฅด๋ฉด ๋ ๋ง์ ๋น๋ฐ์งํฉ๋ค์ ์ป์ ์ ์๊ณ , ์ด๋ ๋น๋ฐ์งํฉ์ ์ต๋ ๊ธธ์ด์ ๊ฐ๋ฅํ ํ๋ณด์งํฉ์ ์๋ฅผ ์ฆ๊ฐ์ํฌ ์ ์๋ค.
b. Dimensionality (number of items) of the data set : More space is needed to store the support count of each item. ๋ง์ฝ item ์๊ฐ ์ฆ๊ฐํ๋ค๋ฉด ๊ณ์ฐ ๋ณต์ก๋๋ ์ฆ๊ฐํ ๊ฒ์ด๋ค.
c. Size of database : apriori ๋ ๋ค์ํ ๊ฒฝ๋ก๋ก ๋ง๋ค์ด์ง๊ธฐ ๋๋ฌธ์ ํธ๋์ ์ ์ ์๋งํผ ์๊ณ ๋ฆฌ์ฆ์ run time ๋ ์ฆ๊ฐํ ๊ฒ์ด๋ค.
d. Average transaction width : Transaction width increases with denser data sets. ์ด๋ ๋น๋ฐ์งํฉ์ ์ต๋ ํฌ๊ธฐ๋ฅผ ์ฆ๊ฐ์ํฌ ์ ์๋ค.
โจ ์ต์ ์ง์ง๋ ์๊ณ๊ฐ ์ ํ, ๋ฐ์ดํฐ์งํฉ์ ์ฐจ์ (ํญ๋ชฉ์์), ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ํฌ๊ธฐ, ํ๊ท ํธ๋์ญ์ ๋๋น
โข FP-growth
โข Motivation
> ์ฌ๋ฌ ๊ฐ์ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์ดํด๋ณด๋ ๊ฒ์ ๋น์ฉ์ด ๋ง์ด ๋ ๋ค. ๋ํ ๊ธด ํจํด์ ์ฐพ๋ ๊ฒ์ ๋ง์ scanning ์ด ํ์ํ๊ณ ๋ง์ ํ๋ณด์งํฉ๋ค์ ์์ฑํด๋ธ๋ค. (# of whole database scan is proportional to the longest pattern)
Bottleneck: candidate-generation-and-test
> candidate generation ์์ ๋ฐ์ํ๋ ๋ณต์ก๋๋ฅผ ํผํด๊ฐ ์๋ ์์๊น โจ FP-growth ์๊ณ ๋ฆฌ์ฆ์ ๋ฑ์ฅ ์ด์
โข Frequent-Pattern Mining without Candidate Generation
> Heuristic : P ๋ฅผ ๋น๋ฐ์งํฉ, S๋ฅผ P๋ฅผ ํฌํจํ๊ณ ์๋ ํธ๋์ญ์ ์ , x๋ฅผ item ์ด๋ผ๊ณ ํ์. ๋ง์ฝ x๊ฐ ๋น๋ฐ ์์ดํ ์ ํด๋นํ๋ค๋ฉด {x}โชP ๋ ๋ฐ๋์ ๋น๋ฐ์งํฉ์ด ๋๋ค.
> FP grwoth ์๊ณ ๋ฆฌ์ฆ์ candidate generation ์ด ํ์์น ์๋ค โญ
> compact ํ ๋ฐ์ดํฐ๊ตฌ์กฐ์ธ FP-tree ๋ frequent pattern mining ์ ์ํ ์ ๋ณด ์ ์ฅ ๊ตฌ์กฐ์ด๋ค.
> ๋น๋ฐ ํจํด์ set ์ ์ดํด๋ณด๊ธฐ ์ํด Recursive mining algorithm ๊ตฌ์กฐ๋ฅผ ์ทจํ๋ค.
โข Intuition

universe ๊ฐ ์ ์ฒด ๋ฐ์ดํฐ์ ์ด๊ณ , P ๋ ๋น๋ฐ์งํฉ์ด๊ณ , S ๋ ํธ๋์ญ์ ์ด๊ณ , S ๋ P ๋ฅผ ํฌํจํ๊ณ ์๋ค. x ๋ ๊ฐ ์์ดํ element ๋ฅผ ์๋ฏธํ๊ณ , S ์์ ๋น๋ฐํ ์์ดํ ์ ํด๋นํ๋ ๊ฒฝ์ฐ์ธ x๊ฐ ์๋ค๊ณ ํ ๋, P+x ๋ ์ ์ฒด ๋ฐ์ดํฐ๋ฒ ์ด์ค์์ ๋น๋ฐํ๋ค๊ณ ๋ณผ ์ ์๋ค. P+x ๊ฐ ๋น๋ฐํ์ง ์๋์ง๋ฅผ ์ฒดํฌํ๊ธฐ ์ํด์ ์ ์ฒด ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์ดํด๋ณผ ํ์๋ ์๋ค. S ๋ง ์ดํด๋ณด๋ฉด ๋๋ค.
โข FP-Tree
FP-growth ์๊ณ ๋ฆฌ์ฆ์ ๋ง๋ค๊ธฐ ์ํด์ FP-tree ๋ฅผ ๋ง๋ค์ด์ผ ํ๋ค.
1) ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ํ ๋ฒ๋ง ํ์ด๋ณด๋ฉด์, ๋น๋ฐํ 1-itemset ๋ค์ ํ์ธํ๋ค. (single item patterns)
a. ๋น๋ฐํ์ง ์์ itemset ์ ์ ๊ฑฐํ๋ค.
2) frequency descending order ์ธ f list ์ ๊ทผ๊ฑฐํ์ฌ ๋น๋ฐ์งํฉ๋ค์ ์ ๋ ฌํ๋ค.
3) DB ๋ฅผ ๋ค์ ํ๋ฒ ๋ ํ์ผ๋ฉด์ FP tree ๋ฅผ ๋ง๋ ๋ค. ๋ถ๋ชจ๋ ธ๋๋ฅผ ์ค์ฌ์ผ๋ก ํธ๋์ญ์ ์ ์์๋ ธ๋๋ก ์ถ๊ฐํ๋ฉฐ ํธ๋ฆฌ๋ฅผ ์์ฑํ๋ค.


์์ ๊ฐ์ ordered frequent items ๋ฅผ ๊ธฐ์ค์ผ๋ก ํ์ฌ, ๊ฐ ํธ๋์ญ์ ๋ณ๋ก ์ดํด๋ณด๋ฉฐ FP tree ๋ฅผ ๋ง๋๋ ๊ณผ์ ์ ๋ค์๊ณผ ๊ฐ๋ค.

TID = 200 ์ ์ค์บ๋ ํ๋ ๊ณผ์ ์ ์์ธํ ์ดํด๋ณด๋ฉด, ์์ดํ ์ด ๊ธฐ์กด ๋ ธ๋์ ์๋ ๊ฒฝ์ฐ์๋ count ๋ฅผ ํ๋์ฉ ์ฆ๊ฐ์ํค๊ณ , ๊ธฐ์กด ๋ ธ๋๊ฐ ์๋ ๊ฒฝ์ฐ๋ ์๋ก์ด path ๋ก ์ถ๊ฐ์ํค๊ณ ์์์ ํ์ธํด ๋ณผ ์ ์๋ค.

์ต์ข ์ ์ผ๋ก ์์ฑ๋ FP tree ๋ ๋ค์๊ณผ ๊ฐ๋ค.

์ด๋ Header table ์ ๋ ธ๋ ์์ FP tree ์์์ ๋ ธ๋์ frequency ๋ฅผ ํท๊ฐ๋ฆฌ์ง ์๋๋ก ์ฃผ์ํ์!
โข FP-Tree Construction
์ด์ฒ๋ผ FP-tree ๋ฅผ ์์ฑํ๋๋ฐ ์์ด ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ๋ฑ 2๋ฒ๋ง ๋ณด๋ฉด ๋๋ค. 1-iemset ๋ฅผ ์ฐพ๊ธฐ ์ํด ํ ๋ฒ, ํธ๋ฆฌ์์ ๊ฐ ํธ๋์ญ์ ์ ์ฝ์ ํ๊ธฐ ์ํด ํ๋ฒ!
์ด์ด์ง๋ mining ์์ ์ FP-tree (very compact, not using the database) ๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์ด๋ฃจ์ด์ง๋ค.
โข How to mine an FP-Tree
(1) forming conditional pattern bases

๋น๋ฐ์งํฉ์ธ ฮฑ ๋ฅผ ํฌํจํ๋ FP-tree ์ prefix path ๋ฅผ ๋ฐ๋ผ๊ฐ๋ฉฐ support ๋ฅผ ๊ณ์ฐํ๋ค.
์๋ฅผ๋ค์ด ฮฑ = {m} ์ธ ๊ฒฝ์ฐ, {m} ์ ๋น๋ฐ์งํฉ์ ํด๋นํ๊ณ , {m} ์ conditional pattern base ๋ฅผ ๊ณ์ฐํ๋ฉด ๋ค์๊ณผ ๊ฐ๋ค. m ์ ํฌํจํ๋ path ๋ FP-tree ์์ ์ดํด๋ดค์ ๋ <f,c,a,m> ์ <f,c,a,b,m> ์ด ์๊ณ , support ๋ฅผ ๊ณ์ฐํ๋ฉด (m ๋ ธ๋์ frequency ๊ฐ support ๊ฐ ๋๋ค) ๊ฐ๊ฐ 2์ 1์ด ๋๋ค.
(2) constructing conditional FP-trees
์์์ ์ดํด๋ณธ conditional pattern base (ฮฑ = {m}) ๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์กฐ๊ฑด๋ถ FP tree ๋ฅผ ์์ฑํ๋๋ฐ, ์๋ ๊ทธ๋ฆผ์ ์ฐธ๊ณ ํ๋ฉด ๋ค์๊ณผ ๊ฐ๋ค. ์ด๋ b ๋ frequency ๊ฐ 1์ด๋ฏ๋ก minsup ์ ์ถฉ์กฑ์ํค์ง ๋ชปํด ์ ์ธ์ํจ๋ค.

(3) recursively mining conditional FP-trees
(1),(2) ์ ํด๋นํ๋ ๊ณผ์ ์ ๋ฐ๋ณต์ ์ผ๋ก ์ํํ๋ฉฐ ๋น๋ฐ์งํฉ๋ค์ ์ฐพ์๊ฐ๋ฉด ๋๋ค.
โข Pattern Growth

โจ ฮฑ ๊ฐ DB ์ ๋น๋ฐ์งํฉ์ด๊ณ , B ๋ ฮฑ ์ conditional pattern base ์ด๊ณ , ฮฒ ๋ B ์ itemset ์ ํด๋นํ ๋, ฮฑUฮฒ ๋ DB ์์ ๋น๋ฐํ๊ณ ฮฒ ๋ B์์ ๋น๋ฐํ๋ค๊ณ ๋ณผ ์ ์๋ค.
โจ Process of mining frequent patterns can be viewed as first mining frequent 1-itemsets and then progressively growing each such itemset by mining its conditional pattern base, which can in turn be done similarly
โจ We successfully transform a frequent k-itemset mining problem into a sequence of k frequent 1-itemset mining problems via a set of conditional pattern bases

โจ {m}๊ณผ {f,c,a} ์ join ์ ๋ชจ๋ ๊ฒฐ๊ณผ๋ ๋ค ๋น๋ฐ์งํฉ {mf}, {mc}, {ma}, {mfc}, {mfa}, {mca}, {mfca}
โข Single path Tree
- Suppose an FP-tree T has a single path P
- The complete set of the frequent patterns of T can be generated by the enumeration of all the combinations of the subpaths of P
- The support is the minimum support of the items contained in the subpath
โข FP-growth algorithm


โข FP-growth algorithm vs Apriori

โ support threshold ๊ฐ์ด ๋ฎ์ผ๋ฉด ๋ ๋ง์ ๋น๋ฐ์งํฉ๋ค์ด ์๊ฒจ๋๊ฒ ๋๊ณ , ๊ทธ๋์ ๊ฐ์ด ๋งค์ฐ ๋ฎ์ ๊ฒฝ์ฐ์๋ ์๊ณ ๋ฆฌ์ฆ์ด ์ฃผ์ด์ง ์๊ฐ ๋ด์ ๋์ํ์ง ๋ชปํ ์ ์๋ค.
โ FP-Growth : Divide and conquer (conditional pattern base ๋ง ๋ณด๋ฉด ๋๋ค), No candidate generation, no candidate test, compressed database, No repeated scan of the entire database, Cheap operations
โฃ Maximal, Closed frequent itemsets
โข Definisions

โธ Closed : An itemset X is closed, if X is frequent and there exists no superset YโX, with the same support as X : ๊ฐ์ฅ support ๊ฐ์ด ํฌ๋ฉด์ ํด๋น itemset ์ด ๊ฐ์ฅ ์์์ ๊ฐ์๊ฐ ์์์ผ ํจ
โธ Maximal : An itemset X is maximal if X is frequent and there exists no superset YโX : support ๊ฐ์ด ๊ฐ์๋ ๋จ



โข Closed itemset์ frequent itemset์ ํ์์งํฉ์ด์ง๋ง, ๋ค๋ฅธ frequent itemset์ผ๋ก๋ถํฐ ๋ ๋ฆฝ์ ์ ๋๋ค. ์ฆ, closed itemset์ ์์ ์ support์ ๊ฐ์ support๋ฅผ ๊ฐ๋ ๋ค๋ฅธ frequent itemset์ด ์กด์ฌํ์ง ์๋ frequent itemset์ ๋๋ค.
โข maximal itemset์ ๋ ์ด์ ํ์ฅ๋ ์ ์๋ frequent itemset์ ๋๋ค.
โข closed itemset๊ณผ maximal itemset์ frequent itemset์ ํน์ํ ๊ฒฝ์ฐ์ ๋๋ค. closed itemset์ frequent itemset ์ค์์ ๋ ๋ฆฝ์ ์ธ ๊ฒ์ ์ฐพ๊ณ , maximal itemset์ frequent itemset ์ค์์ ๋ ์ด์ ํ์ฅ๋ ์ ์๋ ๊ฒ์ ์ฐพ์ต๋๋ค.
โข superset : superset์ ์ด๋ค ์์ดํ ์งํฉ์ ๋ํด, ํด๋น ์์ดํ ์งํฉ์ ํฌํจํ๋ ๋ ํฐ ์์ดํ ์งํฉ์ ์๋ฏธํฉ๋๋ค. ์๋ฅผ ๋ค์ด, {์ฐ์ , ๊ณ๋}์ด๋ผ๋ ์์ดํ ์งํฉ์ด ์์ ๋, {์ฐ์ , ๊ณ๋, ๋นต}์ {์ฐ์ , ๊ณ๋}์ superset์ด ๋ฉ๋๋ค.
3. Rule Generation
๋น๋ฐ์งํฉ์ ์์ฑํ๋ ์๊ณ ๋ฆฌ์ฆ (Apriori, FP-Growth) ์ ๋ํด ๋ฐฐ์ ๋ค. ์ด์ ํด๋น ๋น๋ฐ์งํฉ์ ์ ๊ฐ์ง๊ณ ์ฐ๊ด๊ท์น์ ๋ง๋๋ ๊ณผ์ ์ ๋ํด ์ดํด๋ณด์.
โข Rule generation

โจ L : ๋น๋ฐ์งํฉ ์์ดํ ์
โจ k : L ์ ์์์ ๊ฐ์
โจ 2^k - 2 : ๊ฐ๋ฅํ ์ฐ๊ด๊ท์น์ ๊ฐ์ (ํ๋ณด ์ฐ๊ด๊ท์น์ ๊ฐ์)
โข ํจ์จ์ ์ผ๋ก ๊ท์น ์์ฑํ๋ ๋ฐฉ๋ฒ

โจ confidence ๋ support ์ ๋ฌ๋ฆฌ, anti-monotone ํ ์ฑ๊ฒฉ์ ๊ฐ์ง๊ณ ์์ง ์๋ค. (ABC โ D) ์ confidence ๋ (AB โ D) ์ confidence ๋ณด๋ค ํด ์๋ ์์์๋ ์๋ค.
โจ ๊ทธ๋ฌ๋ ๊ฐ์ itemset ์ผ๋ก๋ถํฐ ์์ฑ๋ ๊ท์น์ confidence ๋ antimonotone ํ ์ฑ๊ฒฉ์ ๊ฐ์ง๊ณ ์๋ค. ์๋ฅผ๋ค์ด L = {A,B,C,D} ๋น๋ฐ์งํฉ์์ ๋ค์๊ณผ ๊ฐ์ ๊ท์น๋ค์ anti-monotone ํ confidence ๊ด๊ณ๋ฅผ ๊ฐ์ง ์ ์๋ค. (ABC โ D) โฝ (AB โ CD) โฝ (A โ BCD) . ํด๋น ๊ท์น๋ค์ ๊ท์น ๋ด์์ ๋ชจ๋ ABCD ์ ์ฒด๋ฅผ ํฌํจํ๊ณ ์๋ค. Right hand side (RHS)
โข Rule Generation for Apriori Algorithm

โจ RHS ๋ฅผ ๋ง์กฑํ๋ ๊ท์น๋ค ์ฌ์ด์์ anti-monotone ์ฑ์ง์ด ์ ์ฉ๋ ์ ์๊ธฐ ๋๋ฌธ์, ์์ ๊ทธ๋ฆผ์ฒ๋ผ ์ ์ผ ์๋จ์ ์๋ ๊ท์น์ confidence ๊ฐ ๋ฎ๋ค๋ฉด, ๊ทธ ํ์ ๊ท์น๋ค ({ABCD} set ์ ๋ง์กฑํ๋ ๊ท์น๋ค) ๋ confidence ๊ฐ ๋ฎ๊ธฐ ๋๋ฌธ์, Prune ํ ์ ์๋ค. (๊ฐ์ง์น๊ธฐ, ์ ๊ฑฐ)

โจ consequent (ํ์ดํ ๋ค์ ์๋ ๊ท์น) ๊ท์น์์ ๊ฐ์ prefix ๋ฅผ ๊ณต์ ํ๊ณ ์๋ ๋ ๊ท์น์ merge ํ์ฌ ์๋ก์ด ํ๋ณด๊ท์น์ ๋ง๋ค ์ ์๋ค. ๊ฐ๋ น (CD โ AB) ์ (BD โ AC) ๊ท์น์ ๊ฒฝ์ฐ, consequent ์์ A๋ผ๋ prefix ๋ฅผ ๊ณต์ ํ๊ณ ์๊ธฐ ๋๋ฌธ์, D โ ABC ๋ผ๋ ๊ท์น์ ์์ฑํ ์ ์๊ณ , confidence ์ RHS ์ anti-monotone ํ ์ฑ์ง์ ์ํด์ ๋ง์ฝ AD โ BC ์ confidence ๊ฐ์ด ๋์ง ์๋ค๋ฉด, ํ๋ณด ๊ท์น์์ ์ ๊ฑฐ๋ ์ ์๋ค.
4. Interestingness measures
โ Applications of interestingness measures
โข interestingness measures
| ์ถ์ถ๋ ์ ๋ณด๊ฐ ์ผ๋ง๋ ํฅ๋ฏธ๋ก์ด์ง, ํน์ ์ผ๋ง๋ ์ ์ฉํ์ง ํ๊ฐํ๋ ์งํ์ด๋ค.

โก Lift
โข Lift = confidence / probability of consequent
| AโB ์ ์ฐ๊ด๊ท์น์์ ์์๋ก B๊ฐ ๊ตฌ๋งค๋๋ ๊ฒฝ์ฐ์ ๋นํด, A์์ ๊ด๊ณ๊ฐ ๊ณ ๋ ค๋์ด ๊ตฌ๋งค๋๋ ๊ฒฝ์ฐ์ ๋น์จ

A์์ 0์ผ๋ก ๊ฐ๋ ๊ท์น์ ๋ํด, support = 3/7 (์ ์ฒด์์ Aโ0 ๊ฐ ๋ฑ์ฅํ ๋น์จ), confidence = 3/4 (A๊ฐ ๋ํ๋ฌ์ ๋ Aโ0 ์ด ๋ฑ์ฅํ ๋น์จ) ๋ก ๊ณ์ฐํ ์ ์๊ณ B์์ 1๋ก ๊ฐ๋ ๊ท์น์ ๋ํด์๋ ๋์ผํ๊ฒ support ์ confidence ๋ฅผ ๊ณ์ฐํด๋ณผ ์ ์๋ค.
Lift ๋ confidence ๋ฅผ probability of consequent ๋ก ๋๋ ๊ฐ์ด๋ค. Rule 1์์ probability of consequent ๋ฅผ ๊ตฌํ๋ฉด, ์ ์ฒด์์ 0์ด ๋ฑ์ฅํ ๋น์จ์ด๋ฏ๋ก 4/7์ด๋ค. Rule 2์์๋ ์ ์ฒด์์ 1์ด ๋ฑ์ฅํ ๋น์จ๋ก 3/7์ด๋ค.
โข Lift ๊ฐ์ด 1๋ณด๋ค ํฌ๋ค๋ฉด, Antecedent ์ Consequent ์ ๋ฐ์์ด ์๋ก ์ฐ๊ด (correlated / dependent) ๋์ด ์๋์ง ์๋ ค์ค๋ค.
โข ๊ท์น1 (Aโ0) ์ ๊ท์น2 (Bโ1) ๋ณด๋ค ๋์ confidence ๋ฅผ ๊ฐ์ง์ง๋ง, lift ๋ ๋ ๋ฎ๋ค.

โข Interestingness measure : Correlation (Lift)

(๋๊ตฌ๋ฅผํ๋ค โ ์๋ฆฌ์ผ์ ๋จน๋๋ค) ๋ผ๋ ๊ท์น์ด ์์ ๋, (support, confidence) ๊ฐ (40%, 66.7%) ๋ก ๊ณ์ฐ๋ ๊ฒฐ๊ณผ๋ ์คํด๋ฅผ ๋ถ๋ฌ์ฌ ์ ์๋ค. (high confidence is misleading) ์ด๋ฏธ ์๋ฆฌ์ผ์ ๋จน๋ ํ์์ ์ ์ฒด ๋น์จ์ด 75% ์ด๋ฏ๋ก, ๊ตณ์ด ๋๊ตฌ๋ฅผ ํ๋ค๋ ๋จ์๊ฐ ๋ถ์ง ์์๋ ์๋ฆฌ์ผ์ ๋จน๋ ํ์๋ค์ %๊ฐ ๋๋ค.
(๋๊ตฌ๋ฅผํ๋ค โ ์๋ฆฌ์ผ์ ๋จน์ง ์๋๋ค) ๋ผ๋ ๊ท์น์ด ์์ ๋, (support, confidence) ๊ฐ (20%, 33.3%) ๋ก ๊ณ์ฐ๋ ๊ฒฐ๊ณผ๊ฐ, ๋น๋ก ๊ฐ์ ๋ฎ๋๋ผ๋ ์ข ๋ ์ ํํ๋ค.
Lift ๊ฐ์ ๊ณ์ฐํด๋ณด๋ฉด, ์ฒซ๋ฒ์งธ ๊ท์น์ 0.89 (1๋ณด๋ค ๊ฐ์ด ์์ผ๋ฏ๋ก ๋๊ตฌ๋ฅผ ํ๋ ๊ฒ๊ณผ ์๋ฆฌ์ผ์ ๋จน๋ ๊ฒ์ ์ฐ๊ด์ฑ์ด ์์์ ์๋ฏธ), ๋๋ฒ์งธ ๊ท์น์ 1.33 (1๋ณด๋ค ํฌ๋ฏ๋ก ์๋ฆฌ์ผ์ ๋จน์ง ์์ ํ๋ฅ ๋ณด๋ค, ๋๊ตฌ๋ฅผ ํ๊ณ ์๋ฆฌ์ผ์ ๋จน์ง ์์ ํ๋ฅ ์ด ๋ ๋์, ๋ ์ฌ์ด์ ์ฐ๊ด์ฑ์ด ๋งค์ฐ ๋์) ์ ๊ฒฐ๊ณผ๊ฐ ๋์จ๋ค.
โข Good measures for correlation?
โช (์๋์ ์ฐ๋ค โ ์ฐ์ ๋ฅผ ์ฐ๋ค) ์ ๊ท์น์ด (support, confidence) = (1%, 80%) ๊ฒฐ๊ณผ๊ฐ ๋์์ ๋, ๋ง์ฝ 85%์ ์๋น์๋ค์ด ์ฐ์ ๋ฅผ ์ฐ๋ค๋ฉด, ํด๋น ๊ฒฐ๊ณผ๋ ์คํด๋ฅผ ๋ถ๋ฌ์ฌ ์ ์๋ค.
โช support ์ confidence ๋ antecedent ์ consequent ์ฌ์ด์ correlation ์ ํด์ํ๋๋ฐ ์ ์ ํ ์งํ๊ฐ ์๋๋ค. ์ ์ ํ ์งํ์ ๋ํด 20๊ฐ ์ด์์ interestingness measure ๊ฐ ์ ์๋ ๋ฐ ์๋ค.
โข Interestingness measures

โข Null-invariant measures

โช ์ฌ๋ฌ๊ฐ์ง ์งํ๋ค ์ค์, null variance ์ฑ์ง์ ๊ฐ์ง ์งํ์ ๋ํด ์ดํด๋ณด์.
โข Comparison of interestingness measures
โช ์๊ด๋ถ์์์ null-invariance ์ฑ์ง์ ๋งค์ฐ ์ค์ํ๋ค. Lift ์ x2 ์ null-invariant ๊ฐ ์๋๋ค.
โช null invariance : not dependent on the null transaction

โช ์์ ์์์์, no milk & no coffee ์ ํด๋นํ๋ ์ ์ด null transaction ์ ๊ฐ์์ด๋ค. chi-square ์ Lift ๊ฐ์ null transaction ์ ์ํฅ์ ๋ฐ๋ ์งํ๋ค์ด๊ธฐ ๋๋ฌธ์, ์๋ก ๊ฒฐ๊ณผ๊ฐ ๋งค์ฐ ์๋ฐ๋๊ฒ ๋์ด์ ์ดํด๋ณผ ์ ์๋ค. ๋ฐ๋ฉด AllConf ์งํ์ ๊ฒฝ์ฐ, Data set 1 ๊ณผ 2 ์ ๋ํด ๊ฐ์ ๊ฐ์ ๊ฐ์ง๋ค. ์ด๋ฌํ ์งํ์ ๊ฒฝ์ฐ๋ null transaction ์ ์ํฅ์ ๋ฐ์ง ์๋ null-invariant ํ ์งํ๋ผ ๋ณผ ์ ์๋ค.
โช D1์ D2 : positive correlated (๋๊ฐ๋ฅผ ๋์์ ๊ตฌ๋งคํ ๊ฒฝ์ฐ๊ฐ ํ์ชฝ๋ง ๊ตฌ๋งคํ ๊ฒฝ์ฐ๋ณด๋ค ๋ง์)
โช D3 : negative correlated (๋๊ฐ๋ฅผ ๋์์ ๊ตฌ๋งคํ ๊ฒฝ์ฐ๊ฐ ํ์ชฝ๋ง ๊ตฌ๋งคํ ๊ฒฝ์ฐ๋ณด๋ค ํจ์ฌ ์ ์)
โช D4,D5,D6 : neutral (ํน์ ํ ํจํด์ด ๋ณด์ด์ง ์์)
โข Example : analysis of DBLP Coauthor relationships
์ปดํจํฐ๊ณผํ ๋ถ์ผ์์ ๋ ผ๋ฌธ ์ถ๊ฐ์ ๊ด๋ จ๋ ๋ฐ์ดํฐ์ ์ ๊ดํ ์์์ด๋ค.

๋ค์ํ ์งํ๋ฅผ ์ดํด๋ด์ผ๋ก์จ ๋ค์ํ ๊ด๊ณ์ ๋ํด ํด์ํด๋ณผ ์ ์๋ค.
โช Kulc ์ ๊ฒฝ์ฐ, ์์ 3๊ฐ์ sup ์ ๋ถํฌ๋ฅผ ๋ณด๋ฉด, sup(ab) ๊ฐ sup(b) ์ ๊ฐ์์ ๋ณผ ์ ์๊ณ , sup(b) ๊ฐ sup(a) ๋ณด๋ค ํ์ ํ ๋ฎ์ ์ซ์์์ ์ ์ ์๋ค. ์ด๋ฌํ ๊ฒฐ๊ณผ๋ฅผ ํด์ํด๋ณด๋ฉด, advisor (๊ต์) - advisee (๋ํ์์) ๊ด๊ณ๋ฅผ ๋์ถํด๋ณผ ์ ์๋ค. ์ด๋ฌํ ๊ด๊ณ๋ skewed ํ ๊ด๊ณ๋ผ ๋ณผ ์ ์๋ค.
โช coherence ์ ๊ฒฝ์ฐ, ์์ 3๊ฐ์ sup ๋ถํฌ๋ฅผ ๋ณด๋ฉด, sup(b) ๊ฐ sup(ab) ๋ณด๋ค ๊ฐ์ด ๋์์ ์ ์ ์๋ค. ์ด๋ ์ ์ b ๊ฐ ๋ ๋ฆฝ์ ์ธ ์ฐ๊ตฌ์์ ํด๋นํ๋ค๊ณ ์ ์ถํด๋ณผ ์ ์๋ค. (๊ต์๋์ ๋์์ ๋ฐ์ง ์๊ณ ์ค์ค๋ก ์ถ๊ฐํ ๋ ผ๋ฌธ์ด ๋ง๋ค)
โช kulc tends to more credit on skewed pattern , coherence prefers balanced pattern, cosine in between
โข Null-invariant ์งํ๊ฐ ๋ ์ข์ ๊ฒ์ธ๊ฐ?
๋ช ํํ๊ฒ ๊ทธ๋ ๋ค๊ณ ๋งํ๊ธฐ๋ ์ด๋ ต๋ค.
โช IR (imbalance ratio) : A์ B์ ๋ถ๊ท ํ์ ์ธก์ ํ๋ ์งํ


โญ Programming
5. Advanced association analysis
Pattern mining roadmap

โ Rare or Negative
โข Infrequent or rare patterns
ex. Rolex ์๊ณ๋ฅผ ๊ตฌ๋งคํ๋ ๊ฒ โ ๋๋ฌผ๊ฒ ๋ํ๋์ง๋ง, ๋งค์ถ์ ์์ด์ ์ค์ํ ๋ฐ์
โข Negative patterns
ex. SUV ์ฐจ๋ฅผ ๊ตฌ๋งคํ๋ ๊ฒ๊ณผ Toyota ์ฐจ๋ฅผ ๊ตฌ๋งคํ๋ ๊ฒ์ ์์ ์๊ดํจํด์ ๋ณด์ธ๋ค โ ์ํ ๊ฐ์ ์์ ๊ด๊ณ์ฑ์ด ๋ณด์ผ ์ ์๋ค.
โก Abstraction levels
โข Multi-level association rules

โช ๋ฎ์ ๋ ๋ฒจ์ ์๋ ์์ดํ ์ผ์๋ก support ๊ฐ ๋ํ ์์ ์ ์๋ค. (Items at the lower level are expected to have lower support)
โข Flexible support and redundancy filtering
โข Flexible min-support thresholds
๋ช๋ช ์ํ๊ตฐ์ ์ ์ ๋น๋๋ก ๋ํ๋์ง๋ง, ๋ ๊ฐ์น์์ ์ ์๋ค. ์ด๋ฐ ๊ฒฝ์ฐ์๋ non-uniformํ group-based min-support ๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด ์ข๋ค.
ex. {๋ค์ด์๋ชฌ๋,์๊ณ,์นด๋ฉ๋ผ} = 0.05%, {๋นต, ์ฐ์ } = 5%
โช ๋น์ผ ์์ดํ ๊ตฐ์ง์ ์๋์ ์ผ๋ก ๋ฐ์ ๋น๋๊ฐ ๋ฎ์ ์ ์๊ธฐ ๋๋ฌธ์ ๋ฎ์ support threshold ๋ฅผ ์ ์ฉํ๋ ๊ฒ์ด ์ข๊ณ , ๋น๊ต์ ์ ๋ ดํ ์์ดํ ๊ตฐ์ง์ ์๋์ ์ผ๋ก ๋ฐ์ ๋น๋๊ฐ ๋์ ์ ์๊ธฐ ๋๋ฌธ์ ๋์ support threshold ๋ฅผ ์ ์ฉํ๋ ๊ฒ์ด ์ ์ ํ ์ ์๋ค.
โข Redundancy Filtering : ๋ช๋ช ๊ท์น์ ancestor ์ ํน์ฑ์ผ๋ก ์ธํด ์ค๋ณต๋ ์ ์๋ค.

2% ์ง๋ฐฉ ์ฐ์ ์ ๋นต์ ๊ท์น์ ์ฐ์ ์ ๋นต์ ๊ท์น๊ณผ ์ค๋ณต๋ ์ ์๋ค. ๊ท์น์ ancestor ์ ๊ธฐ๋ฐํ expected support value (์์์๋ 8%/4 = 2%๋ก ์์ ์ผ์น) ๊ฐ ๋น์ทํ๋ค๋ฉด, ํด๋น ๊ท์น์ ์ค๋ณต (redundant) ๋ฌ๋ค๊ณ ๋ณผ ์ ์๋ค. 2% milk ๊ท์น์ ์ค๋ณต๋ ๊ท์น์ด๋ค.
โฃ # of dimensions
โข Multi-dimensional association rules
2๊ฐ ์ด์์ ์ฐจ์์ ๋ํ๋ด๋ ์ฐ๊ด๊ท์น์ด ์กด์ฌํ ์ ์๋ค.

single dimension ์ ๊ฐ์ง๋ ๊ท์น์ ์๋ ๋ค์๊ณผ ๊ฐ๋ค. ์๋์ ๊ท์น์ buys ์์ buys ๋ก ๊ฐ๋ ๊ท์น์ด๋ค.

โค Types of values
โข Quantitative association rules
์์นํ ๊ฐ์ ๊ฐ์ง ์ํ๊ตฐ๊ณผ ๋ฒ์ฃผํ ๊ฐ์ ๊ฐ์ง ์ํ๊ตฐ ์ฌ์ด์ ์ฐ๊ด๊ท์น

โฅ Constraints or Criteria
โข Constraint-based
โช Those satisfying a set of user-defined constraints
โข Approximate, compressed, near-match
โช Those that tally the support count of the near or almost matching itemsets
โข Top-k
โช The k most frequent itemsets for a user-specified value k
โข Redundancy-aware top-k
โช The top-k patterns with similar or redundant patterns excluded
โฆ Constraints or Criteria : Constraints in data mining
โข Knowledge type constraint : Classification, association
โข Data constraint - using SQL like queries : Finding product pairs sold together in stores in Chicago this year โ Region area constraints (Chicago), temporal constraints (this year)
โข Dimension/level constraint: In relevance to region, price, brand, customer category
โข Rule (or pattern) constraint : Small sales (price < $10) trigger big sales (sum > $200)
โข Interestingness constraint : Strong rules: min_support โฝ 3%, min_confidence โฝ 60%
โง Constraints or Criteria : Compressed Patterns
โข we do not keep all frequent patterns

โข closed frequent patterns ๋ฅผ ๊ธฐ์ค์ผ๋ก compression ์ ํ๊ณ ์ ํ ๋๋, P1, P2, P3, P4, P5 ๋ชจ๋๊ฐ closed form ์ด๊ธฐ ๋๋ฌธ์, ์์ถํ ๊ฒ์ด ์๋ค.
โข Maximal frequent patterns ๋ฅผ ๊ธฐ์ค์ผ๋ก compression ์ ํ๊ณ ์ ํ ๋, maximal form ์ ํด๋นํ๋ ID ๋ P3 ์ด๊ธฐ ๋๋ฌธ์, 5๊ฐ์ง ID ์ ๋ํด P3 ๋ง์ ์ ํํ๊ฒ ๋๋ค. ๊ทธ๋ฌ๋ ์ด๋ฌํ ๊ฒฝ์ฐP1,P2,P4,P5 ๋ฅผ ๋ชจ๋ ๋ฒ๋ฆฌ๊ธฐ ๋๋ฌธ์ ์ ๋ณด์ ์์ค์ด ๋ฐ์ํ๋ค.
โข ๊ฐ์ฅ ์ข์ compression ๋ฐฉ๋ฒ์, pattern ๊ฐ์ distance ๋ฅผ ๊ตฌํด์ clustering ์ ํ๋ ๋ฐฉ๋ฒ์ด๋ค.
โจ Constraints or Criteria : Redundancy-Award Top-k patterns
โข ๋์ significance & ๋ฎ์ redundancy : redundancy award top-k ๋ฐฉ์์ ์ ์ฉํ (b) ๊ฐ ํด๋น ์กฐ๊ฑด์ ๋ง์กฑํ๋ค.

โข (c)์์๋ significance (๊ฐ๋ น lift ์งํ) ๊ฐ ๊ฐ์ฅ ๋์ ๊ฒ๋ค์ ๊ณ ๋ฅด๊ณ , (d) ์์๋ ์ ๋ณด๊ฐ ์ค๋ณต๋์ง ์๋๋ก clustering ์์ ํ๊ฐ์ฉ ๊ณ ๋ฅธ๋ค. ์ด ๋์ ์ ์ ํ ์์ ๊ฒ์ด (b) ์ด๋ค. ์ ํ๋ 3๊ฐ๋ฅผ ๋ณด๋ฉด, significance ๊ฐ ๊ฐ์ฅ ๋์ ๊ฒ ๋ค ์ค ๋ฉ๋ฆฌ ๋จ์ด์ง ๋ ๊ฐ๋ฅผ ๊ณ ๋ฅด๊ณ , ๊ทธ ๋ค์ lift (์งํ์) ๋ค ์ค ๊ฐ์ฅ ๊ฑฐ๋ฆฌ๊ฐ ์๋ ์ค๋ฅธ์ชฝ ๋๊ทธ๋ผ๋ฏธ๋ฅผ ๊ณ ๋ฅธ๋ค.
โฉ Kinds of Data and Features
โข Frequent itemset mining
โข Sequential patterns : Frequent sequences of ordered events (ex. PC ๋ฅผ ๋จผ์ ์ฌ๊ณ , ๋์งํธ ์นด๋ฉ๋ผ๋ฅผ ์ฌ๊ณ , ๊ทธ ๋ค์์ ๋ฉ๋ชจ๋ฆฌ์นด๋๋ฅผ ์ฌ๊ณ )
โข Structural patterns : Frequent substructures (ex. ํํ ๊ตฌ์กฐ๋ฌผ)
โข Application-Domain specific
โช ๋๋ฉ์ธ์ ๋ฐ๋ผ ๋ฐ๊ฒฌํ ์ ์๋ ํจํด์ ๋ค๋ฅด๋ค.

โข Data analysis Usage
โช ๋น๋ฐํจํด๋ง์ด๋์ ๋ฐ์ดํฐ ๋ถ์์ ์ค๊ฐ๋จ๊ณ๋ก ํ์ฉ๋ ์ ์๋ค.

'1๏ธโฃ AIโขDS > ๐ ๋จธ์ ๋ฌ๋' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Uplift modeling (0) | 2023.06.06 |
---|---|
๋ฐ์ดํฐ๋ง์ด๋ Classification (decision tree) (1) | 2023.04.15 |
๋ฐ์ดํฐ๋ง์ด๋ Preprocessing โข (0) | 2023.03.29 |
๋ฐ์ดํฐ๋ง์ด๋ Preprocessing โก (0) | 2023.03.15 |
๋ฐ์ดํฐ๋ง์ด๋ Preprocessing โ (1) | 2023.03.15 |
๋๊ธ