35 Pages

assoc-rules2-3

Course: CS 345, Fall 2001
School: Stanford
Rating:
 
 
 
 
 

Word Count: 1354

Document Preview

to Improvements APriori ParkChenYu Algorithm Multistage Algorithm Approximate Algorithms Compacting Results 1 PCY Algorithm x Hashbased improvement to APriori. x During Pass 1 of Apriori, most memory is idle. x Use that memory to keep counts of buckets into which pairs of items are hashed. x Gives extra condition that candidate pairs must satisfy on Pass 2. 2 Just the count, not the pairs themselves....

Register Now

Unformatted Document Excerpt

Coursehero >> California >> Stanford >> CS 345

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
to Improvements APriori ParkChenYu Algorithm Multistage Algorithm Approximate Algorithms Compacting Results 1 PCY Algorithm x Hashbased improvement to APriori. x During Pass 1 of Apriori, most memory is idle. x Use that memory to keep counts of buckets into which pairs of items are hashed. x Gives extra condition that candidate pairs must satisfy on Pass 2. 2 Just the count, not the pairs themselves. Picture of PCY Item counts Hash table Frequent items Bitmap Counts of candidate pairs Pass 2 3 Pass 1 PCY Algorithm Before Pass 1 Organize Main Memory x Space to count each item. One (typically) 4byte integer per item. x Use the rest of the space for as many integers, representing buckets, as we can. 4 PCY Algorithm Pass 1 FOR (each basket) { FOR (each item) add 1 to item's count; FOR (each pair of items) { hash the pair to a bucket; add 1 to the count for that bucket } } 5 Observations About Buckets 1. If a bucket contains a frequent pair, then the bucket is surely frequent. 1. Even without any frequent pair, a bucket can be frequent. Again, nothing in the bucket can be eliminated. 6 We cannot use the hash table to eliminate any member of this bucket. Observations (2) 3. But in the best case, the count for a bucket is less than the support s. Now, all pairs that hash to this bucket can be eliminated as candidates, even if the pair consists of two frequent items. 7 PCY Algorithm Between Passes x Replace the buckets by a bitvector: 1 means the bucket count exceeds the support s (a frequent bucket ); 0 means it did not. x 4byte integers are replaced by bits, so the bitvector requires 1/32 of memory. x Also, decide which items are frequent and list them for the second pass. 8 PCY Algorithm Pass 2 x Count all pairs {i, j } that meet the conditions: x Notice all these conditions are necessary for the pair to have a chance of being frequent. 9 1. Both i and j are frequent items. 2. The pair {i, j }, hashes to a bucket number whose bit in the bit vector is 1. Memory Details x Hash table requires buckets of 24 bytes. x On second pass, a table of (item, item, count) triples is essential. Number of buckets thus almost 1/41/2 of the number of bytes of main memory. Thus, hash table must eliminate 2/3 of the candidate pairs to beat apriori. 10 Multistage Algorithm x Key idea: After Pass 1 of PCY, rehash only those pairs that qualify for Pass 2 of PCY. x On middle pass, fewer pairs contribute to buckets, so fewer false positives frequent buckets with no frequent pair. 11 Multistage Picture Item counts Freq. items Freq. items First hash table Bitmap 1 Second hash table Bitmap 1 Bitmap 2 Counts of candidate pairs Pass 3 12 Pass 1 Pass 2 Multistage Pass 3 x Count only those pairs {i, j } that satisfy: 1. Both i and j are frequent items. 2. Using the first hash function, the pair hashes to a bucket whose bit in the first bitvector is 1. 3. Using the second hash function, the pair hashes to a bucket whose bit in the second bitvector is 1. 13 Important Points 1. The two hash functions have to be independent. 2. We need to check both hashes on the third pass. If not, we would wind up counting pairs of frequent items that hashed first to an infrequent bucket but happened to hash second to a frequent bucket. 14 Multihash x Key idea: use several independent hash tables on the first pass. x Risk: halving the number of buckets doubles the average count. We have to be sure most buckets will still not reach count s. x If so, we can get a benefit like multistage, but in only 2 passes. 15 Multihash Picture Item counts Freq. items First hash table Second hash table Pass 1 Bitmap 1 Bitmap 2 Counts of candidate pairs Pass 2 16 Extensions x Either multistage or multihash can use more than two hash functions. x In multistage, there is a point of diminishing returns, since the bitvectors eventually consume all of main memory. x For multihash, the bitvectors occupy exactly what one PCY bitmap does, but too many hash functions makes all counts > s. 17 All (Or Most) Frequent Itemsets < In 2 Passes x Simple algorithm. x SON (Savasere, Omiecinski, and Navathe). x Toivonen. 18 Simple Algorithm (1) x Take a random sample of the market baskets. x Run apriori or one of its improvements (for sets of all sizes, not just pairs) in main memory, so you don't pay for disk I/O each time you increase the size of itemsets. Be sure you leave enough space for counts. 19 MainMemory Picture Copy of sample baskets Space for counts 20 Simple Algorithm (2) x Use as your support threshold a suitable, scaledback number. E.g., if your sample is 1/100 of the baskets, use s /100 as your support threshold instead of s . 21 Simple Algorithm Option x Optionally, verify that your guesses are truly frequent in the entire data set by a second pass. x But you don't catch sets frequent in the whole but not in the sample. But requires more space. Smaller threshold, e.g., s /125, helps catch more truly frequent itemsets. 22 SON Algorithm (1) x Repeatedly read small subsets of the baskets into main memory and perform the first pass of the simple algorithm on each subset. x An itemset becomes a candidate if it is found to be frequent in any one or more subsets of the baskets. 23 SON Algorithm (2) x On a second pass, count all the candidate itemsets and determine which are frequent in the entire set. x Key "monotonicity" idea: an itemset cannot be frequent in the entire set of baskets unless it is frequent in at least one subset. 24 SON Algorithm Distributed Version x This idea lends itself to distributed data mining. x If baskets are distributed among many nodes, compute frequent itemsets at each node, then distribute the candidates from each node. x Finally, accumulate the counts of all candidates. 25 Toivonen's Algorithm (1) x Start as in the simple algorithm, but lower the threshold slightly for the sample. Example: if the sample is 1% of the baskets, use s /125 as the support threshold rather than s /100. Goal is to avoid missing any itemset that is frequent in the full set of baskets. 26 Toivonen's Algorithm (2) x Add to the itemsets that are frequent in the sample the negative border of these itemsets. x An itemset is in the negative border if it is not deemed frequent in the sample, but all its immediate subsets are. 27 Example: Negative Border x ABCD is in the negative border if and only if it is not frequent, but all of ABC, BCD, ACD, and ABD are. 28 Picture of Negative Border Negative Border ... tripletons doubletons singletons Frequent Itemsets 29 Toivonen's Algorithm (3) x In a second pass, count all candidate frequent itemsets from the first pass, and also count their negative border. x If no itemset from the negative border turns out to be frequent, then the candidates found to be frequent in the whole data are exactly the frequent itemsets. 30 Toivonen's Algorithm (4) x What if we find that something in the negative border is actually frequent? x We must start over again! x Try to choose the support threshold so the probability of failure is low, while the number of itemsets checked on the second pass fits in mainmemory. 31 Theorem: x If there is an itemset that is frequent in the whole, but not frequent in the sample, then there is a member of the negative border for the sample that is frequent in the whole. 32 Proof: x Suppose not; i.e., there is an itemset S frequent in the whole but Not frequent in the sample, and Not present in the sample's negative border. x Let T be a smallest subset of S that is not frequent in the sample. x T is frequent in the whole (S is frequent, monotonicity). x T is in the negative border (else not "smallest"). 33 Compacting the Output 1. Maximal Frequent itemsets : no immediate superset is frequent. 2. Closed itemsets : no immediate superset has the same count (> 0). Stores not only frequent information, but exact counts. 34 Example: Maximal/Closed Count Maximal (s=3) Closed A 4 No No B 5 No Yes C 3 No No AB 4 Yes Yes AC 2 No No BC 3 Yes Yes ABC 2 No Yes 35
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Stanford - CS - 345
Improvements to APrioriBloom Filters ParkChenYu Algorithm Multistage Algorithm Approximate Algorithms Compacting Results1Aside: HashBased Filteringx Simple problem: I have a set S of one billion strings of length 10. x I want to scan a larger file F o
Stanford - CS - 345
SQL/MRPeter Pawlowski Member of Technical Staff January 16, 2009ASTER BACKGROUND2Our Founders3 PhD students from Stanford C.S. Cool ideas. . but no funding, no product, no clients!OK, they had $ 10,000.3Our Product: nCluster A massively scalable
Stanford - CS - 345
Clustering AlgorithmsApplications Hierarchical Clustering k Means Algorithms CURE Algorithm1The Problem of Clusteringx Given a set of points, with a notion of distance between points, group the points into some number of clusters, so that members of a
Stanford - CS - 345
Clustering PreliminariesApplications Euclidean/Non-Euclidean Spaces Distance Measures1The Problem of ClusteringGiven a set of points, with a notion of distance between points, group the points into some number of clusters, so that members of a cluster
Stanford - CS - 345
Clustering PreliminariesApplications Euclidean/NonEuclidean Spaces Distance Measures1The Problem of Clusteringx Given a set of points, with a notion of distance between points, group the points into some number of clusters, so that members of a cluste
Stanford - CS - 345
Clustering PreliminariesApplications Euclidean/Non-Euclidean Spaces Distance Measures1The Problem of ClusteringGiven a set of points, with a notion of distance between points, group the points into some number of clusters, so that members of a cluster
Stanford - CS - 345
Clustering PreliminariesApplications Euclidean/NonEuclidean Spaces Distance Measures1The Problem of Clusteringx Given a set of points, with a notion of distance between points, group the points into some number of clusters, so that members of a cluste
Stanford - CS - 345
Clustering AlgorithmsHierarchical Clustering k -Means Algorithms CURE Algorithm1Methods of ClusteringHierarchical (Agglomerative):Initially, each point in cluster by itself. Repeatedly combine the two &quot;nearest&quot; clusters into one.Point Assignment:Ma
Stanford - CS - 345
Clustering AlgorithmsHierarchical Clustering k Means Algorithms CURE Algorithm1Methods of Clusteringx Hierarchical (Agglomerative): Initially, each point in cluster by itself. Repeatedly combine the two &quot;nearest&quot; clusters into one. Maintain a set of
Stanford - CS - 345
Clustering AlgorithmsHierarchical Clustering k -Means Algorithms CURE Algorithm1Methods of ClusteringHierarchical (Agglomerative):Initially, each point in cluster by itself. Repeatedly combine the two nearest clusters into one.Point Assignment:Main
Stanford - CS - 345
Clustering AlgorithmsHierarchical Clustering k Means Algorithms CURE Algorithm1Methods of Clusteringx Hierarchical (Agglomerative): Initially, each point in cluster by itself. Repeatedly combine the two &quot;nearest&quot; clusters into one. Maintain a set of
Stanford - CS - 345
CS345 Data Mining Crawling the Web Web Crawling BasicsStart with a &quot;seed set&quot; of tovisit urlsget next url get page extract urlsto visit urlsWebvisited urlsweb pagesCrawling Issues Load on web servers Insufficient resources to crawl entire web
Stanford - CS - 345
Problem 1:a) True Consider visiting the rows in the permuted order. The first time you see a one in any of the two columns, the column C1 \/ C2 will also have a one. Consequently, the first (minimum) row number which corresponds to the min hash value for
Stanford - CS - 345
Locality-Sensitive HashingBasic Technique Hamming-LSH Applications1Finding Similar PairsSuppose we have in main memory data representing a large number of objects.May be the objects themselves (e.g., summaries of faces). May be signatures as in minha
Stanford - CS - 345
LocalitySensitive HashingBasic Technique HammingLSH Applications1Finding Similar Pairsx Suppose we have in main memory data representing a large number of objects. May be the objects themselves (e.g., summaries of faces). May be signatures as in minh
Stanford - CS - 345
Finding Similar PairsDivideComputeMerge LocalitySensitive Hashing Applications1Finding Similar Pairsx Suppose we have in main memory data representing a large number of objects. May be the objects themselves (e.g., summaries of faces). May be signatu
Stanford - CS - 345
Mining Data StreamsThe Stream Model Sliding Windows Counting 1s1The Stream ModelData enters at a rapid rate from one or more input ports. The system cannot store the entire stream. How do you make critical calculations about the stream using a limited
Stanford - CS - 345
Mining Data StreamsThe Stream Model Sliding Windows Counting 1's1The Stream Modelx Data enters at a rapid rate from one or more input ports. x The system cannot store the entire stream. x How do you make critical calculations about the stream using a
Stanford - CS - 345
Mining Data StreamsThe Stream Model Sliding Windows Counting 1's1Data Management Versus Stream ManagementIn a DBMS, input is under the control of the programmer.SQL INSERT commands or bulk loaders.Stream Management is important when the input rate i
Stanford - CS - 345
Mining Data StreamsThe Stream Model Sliding Windows Counting 1's1Data Management Versus Stream Managementx In a DBMS, input is under the control of the programmer. x Stream Management is important when the input rate is controlled externally. Example
Stanford - CS - 345
More Stream-MiningCounting How Many Elements Computing Moments1Counting Distinct ElementsProblem: a data stream consists of elements chosen from a set of size n. Maintain a count of the number of distinct elements seen so far. Obvious approach: mainta
Stanford - CS - 345
More StreamMiningCounting How Many Elements Computing &quot;Moments&quot;1Counting Distinct Elementsx Problem: a data stream consists of elements chosen from a set of size n. Maintain a count of the number of distinct elements seen so far. x Obvious approach: m
Stanford - CS - 345
More Stream-MiningCounting Distinct Elements Computing &quot;Moments&quot; Frequent Itemsets Elephants and Troops Exponentially Decaying Windows1Counting Distinct ElementsProblem: a data stream consists of elements chosen from a set of size n. Maintain a count
Stanford - CS - 345
More StreamMiningCounting Distinct Elements Computing &quot;Moments&quot; Frequent Itemsets Elephants and Troops Exponentially Decaying Windows1Counting Distinct Elementsx Problem: a data stream consists of elements chosen from a set of size n. Maintain a count
Stanford - CS - 345
Still More Stream-MiningFrequent Itemsets Elephants and Troops Exponentially Decaying Windows1Counting ItemsProblem: given a stream, which items appear more than s times in the window? Possible solution: think of the stream of baskets as one binary st
Stanford - CS - 345
Still More StreamMiningFrequent Itemsets Elephants and Troops Exponentially Decaying Windows1Counting Itemsx Problem: given a stream, which items appear more than s times in the window? x Possible solution: think of the stream of baskets as one binary
Stanford - CS - 345
Stream ClusteringExtension of DGIM to More Complex Problems1Clustering a StreamAssume points enter in a stream. Maintain a sliding window of points. Queries ask for clusters of points within some suffix of the window. Important issue: where are the cl
Stanford - CS - 345
Stream ClusteringExtension of DGIM to More Complex Problems1Clustering a Streamx Assume points enter in a stream. x Maintain a sliding window of points. x Queries ask for clusters of points within some suffix of the window. x Important issue: where ar
Stanford - CS - 345
CS345 Data MiningIntroductions What Is It? Cultures of Data Mining1Course Staffx Instructors: Anand Rajaraman Jeff Ullman Robbie Yanx TA:2Requirementsx Homework (Gradiance and other) 20% x Project 40% x Final Exam 40% Gradiance class code BB8F69
Stanford - CS - 345
CS345 - Data MiningIntroductions What Is It? Cultures of Data Mining1Course StaffInstructors:Anand Rajaraman Jeff UllmanTA:Jeff Klingner2RequirementsHomework (Gradiance and other) 20%Gradiance class code DD984360Project 40% Final Exam 40%3Pr
Stanford - CS - 345
CS345 Data MiningIntroductions What Is It? Cultures of Data Mining1Course Staffx Instructors: Anand Rajaraman Jeff Ullman Jeff Klingnerx TA:2Requirementsx Homework (Gradiance and other) 20% x Project 40% x Final Exam 40% Gradiance class code DD9
Stanford - CS - 345
CS345 - Data MiningCourse Introduction Varieties of Data Mining Bonferroni's Principle1Course StaffInstructors:Anand Rajaraman Jeff UllmanTA:Babak Pahlavan2RequirementsHomework (Gradiance and other) 20%Gradiance class code B0E9AA66 Note URL for
Stanford - CS - 345
CS345A: Data Mining on the WebCourse Introduction Issues in Data Mining Bonferroni's Principle1Course Staffx Instructors: Anand Rajaraman Jeff Ullman Babak Pahlavanx TA:2Requirementsx Homework (Gradiance and other) 20% Gradiance class code B0E9A
Stanford - CS - 345
CS345A: Data Mining on the WebCourse Introduction Issues in Data Mining Bonferroni's Principle1Course Staffx Instructors: Anand Rajaraman Jeff Ullmanx Reach us as cs345awin0809staff @ lists.stanford.edu. x More info on www.stanford.edu/class/cs345a.
Stanford - CS - 345
Generalizing MapReduceThe Computational Model MapReduceLike Algorithms Computing Joins1Overviewx There is a new computing environment available: x Mapreduce allows us to exploit this environment easily. x But not everything is mapreduce. x What else c
Stanford - CS - 345
CS 345A Data MiningMapReduceSingle-node architectureCPU Machine Learning, Statistics Memory &quot;Classical&quot; Data Mining DiskCommodity ClustersWeb data sets can be very largeTens to hundreds of terabytesCannot mine on a single server (why?) Standard arc
Stanford - CS - 345
CS 345A Data MiningMapReduce Singlenode architectureCPU Machine Learning, Statistics Memory &quot;Classical&quot; Data Mining DiskCommodity ClustersWeb data sets can be very large Cannot mine on a single server (why?) Standard architecture emerging: Te
Stanford - CS - 345
CS 345A Data MiningMapReduceSingle-node architectureCPU Machine Learning, Statistics Memory Classical Data Mining DiskCommodity ClustersWeb data sets can be very largeTens to hundreds of terabytesCannot mine on a single server (why?) Standard archi
Stanford - CS - 345
CS 345A Data MiningMapReduce Singlenode architectureCPU Machine Learning, Statistics Memory &quot;Classical&quot; Data Mining DiskCommodity ClustersWeb data sets can be very large Cannot mine on a single server (why?) Standard architecture emerging: Te
Stanford - CS - 345
Near-Neighbor SearchApplications Matrix Formulation Minhashing1Example Application: Face RecognitionWe have a database of (say) 1 million face images. We want to find the most similar images in the database. Represent faces by (relatively) invariant v
Stanford - CS - 345
NearNeighbor SearchApplications Matrix Formulation Minhashing1Example Application: Face Recognitionx We have a database of (say) 1 million face images. x We want to find the most similar images in the database. x Represent faces by (relatively) invari
Stanford - CS - 345
Near-Neighbor SearchApplications Matrix Formulation Minhashing1Example Problem - Face RecognitionWe have a database of (say) 1 million face images. We are given a new image and want to find the most similar images in the database. Represent faces by (
Stanford - CS - 345
NearNeighbor SearchApplications Matrix Formulation Minhashing1Example Problem Face Recognitionx We have a database of (say) 1 million face images. x We are given a new image and want to find the most similar images in the database. x Represent faces b
Stanford - CS - 345
What is Database Theory?A collection of studies, often connected to the relational model of data. Restricted forms of logic, between SQL and full rst-order. Dependency theory: generalizing functional dependencies. Conjunctive queries CQ's: useful, decida
Stanford - CS - 345
CS345 Data MiningLink Analysis Algorithms Page Rank Anand Rajaraman, Jeffrey D. UllmanLink Analysis Algorithms Page Rank Hubs and Authorities TopicSpecific Page Rank Spam Detection Algorithms Other interesting topics we won't cover Detecting dup
Stanford - CS - 345
Link Analysis AlgorithmsCS345 Data MiningLink Analysis Algorithms Page RankPage Rank Hubs and Authorities Topic-Specific Page Rank Spam Detection Algorithms Other interesting topics we wont coverDetecting duplicates and mirrors Mining for communities
Stanford - CS - 345
CS345 Data MiningLink Analysis Algorithms Page Rank Anand Rajaraman, Jeffrey D. UllmanLink Analysis Algorithms Page Rank Hubs and Authorities TopicSpecific Page Rank Spam Detection Algorithms Other interesting topics we won't cover Detecting dup
Stanford - CS - 345
CS345 Data MiningLink Analysis Algorithms Page RankAnand Rajaraman, Jeffrey D. UllmanLink Analysis AlgorithmsPage Rank Hubs and Authorities Topic-Specific Page Rank Spam Detection Algorithms Other interesting topics we wont coverDetecting duplicates
Stanford - CS - 345
CS345 Data MiningLink Analysis Algorithms Page RankAnand Rajaraman, Jeffrey D. UllmanLink Analysis AlgorithmsPage Rank Hubs and Authorities Topic-Specific Page Rank Spam Detection Algorithms Other interesting topics we won't coverDetecting duplicates
Stanford - CS - 345
CS345 Data MiningLink Analysis Algorithms Page Rank Anand Rajaraman, Jeffrey D. UllmanLink Analysis Algorithms Page Rank Hubs and Authorities TopicSpecific Page Rank Spam Detection Algorithms Other interesting topics we won't cover Detecting dup
Stanford - CS - 345
TopicsCS345 Data MiningLink Analysis 2 Page Rank VariantsThis lectureMany-walkers model Tricks for speeding convergence Topic-Specific Page RankAnand Rajaraman, Jeffrey D. UllmanRandom walk interpretationAt time 0, pick a page on the web uniformly
Stanford - CS - 345
CS345 Data MiningLink Analysis 2 Page Rank Variants Anand Rajaraman, Jeffrey D. UllmanTopicsThis lecture Manywalkers model Tricks for speeding convergence TopicSpecific Page RankRandom walk interpretation At time 0, pick a page on the web unif
Stanford - CS - 345
CS345 Data MiningRecommendation SystemsAnand Rajaraman, Jeffrey D. UllmanRecommendationsSearchRecommendationsItemsProducts, web sites, blogs, news items, The Long TailSource: Chris Anderson (2004)From scarcity to abundanceShelf space is a scarc
Stanford - CS - 345
CS345 Data MiningRecommendation Systems Netflix Challenge Course Projects Anand Rajaraman, Jeffrey D. UllmanRecommendations SearchRecommendationsItemsProducts, web sites, blogs, news items, .From scarcity to abundanceShelf space is a scarce com
Stanford - CS - 345
CS345 Data MiningRecommendation Systems Anand Rajaraman, Jeffrey D. UllmanRecommendations SearchRecommendationsItemsProducts, web sites, blogs, news items, .The Long TailSource: Chris Anderson (2004)From scarcity to abundanceShelf space is a
Stanford - CS - 345
CS345 Data MiningRecommendation Systems Netflix Challenge Anand Rajaraman, Jeffrey D. UllmanRecommendations SearchRecommendationsItemsProducts, web sites, blogs, news items, .From scarcity to abundanceShelf space is a scarce commodity for tradi
Stanford - CS - 345
RecommendationsCS345 Data MiningRecommendation Systems Netflix Challenge Course ProjectsSearch RecommendationsItemsProducts, web sites, blogs, news items, Anand Rajaraman, Jeffrey D. UllmanFrom scarcity to abundanceShelf space is a scarce commodit
Stanford - CS - 345
CS345 Data MiningMining the Web for Structured DataOur view of the web so farWeb pages as atomic units Great for some applicationse.g., Conventional web searchBut not always the right modelGoing beyond web pagesQuestion answeringWhat is the height
Stanford - CS - 345
CS345 Data MiningMining the Web for Structured Data Our view of the web so far. Web pages as atomic units Great for some applicationsBut not always the right modele.g., Conventional web searchGoing beyond web pagesQuestion answering Relation
Stanford - CS - 345
CS345 Data MiningMining the Web for Structured DataOur view of the web so farWeb pages as atomic units Great for some applicationse.g., Conventional web searchBut not always the right modelGoing beyond web pagesQuestion answeringWhat is the height
Stanford - CS - 345
CS345 DataMiningMiningtheWebforStructured DataOurviewofthewebsofar Webpagesasatomicunits GreatforsomeapplicationsButnotalwaystherightmodele.g.,ConventionalwebsearchGoingbeyondwebpagesQuestionanswering RelationExtractionWhatistheheightofMtEveres