| Input: transaction database D. |
| Output: frequent item set L of D |
(1) | Start |
(2) | Scan D |
(3) | For each transaction T ∈ D { |
(4) | Find all subitem of T subItemSet |
(5) | For i = 1; i < max_t; i++ { |
(6) | If length of subitem = i { |
(7) | If i_hashTable not contain the subitem { |
(8) | Subitem.count = 1 |
(9) | Add subitem to i_hashTable |
(10) | } else { |
(11) | Subitem.count+ = 1 |
(12) | Value = subitem.count |
(13) | Update value of key subitem in i_hashTable |
(14) | } |
(15) | } |
(16) | } |
(17) | } |
(18) | If there is an update to the database data, cache the updated data |
(19) | Cache the updated data to the data set db_delete, db_add, db_update, db_noupdate, respectively |
(20) | If db_update not null { |
(21) | Add db_update to db_add |
(22) | Add db_noupdate to db_delete |
(23) | } |
(24) | If db_delete not null { |
(25) | For each transaction T ∈ db_delete { |
(26) | Find all subitem of T subItemSet |
(27) | For each subitem ∈ subItemSet { |
(28) | Find the subitem key-value |
(29) | Subitem.count− = 1 |
(30) | Update value of key subitem in i_hashTable |
(31) | } |
(32) | } |
(33) | } |
(34) | Produce has_infrequent_subset (c, Lk − 1) |
(35) | For all (k − 1) subset s of c |
(36) | If s in Lk − 1 return true; |
(37) | Else return false |
(38) | End |