Data Warehousing & Mining. Data integration. OLTP versus OLAP. CPS 116 Introduction to Database Systems

Similar documents
Data Warehousing and Data Mining. Announcements (December 1) Data integration. CPS 116 Introduction to Database Systems

Apriori Algorithm. 1 Bread, Milk 2 Bread, Diaper, Beer, Eggs 3 Milk, Diaper, Beer, Coke 4 Bread, Milk, Diaper, Beer 5 Bread, Milk, Diaper, Coke

Chapter 4: Mining Frequent Patterns, Associations and Correlations

Frequent Pattern Mining. Based on: Introduction to Data Mining by Tan, Steinbach, Kumar

BCB 713 Module Spring 2011

CS377: Database Systems Data Warehouse and Data Mining. Li Xiong Department of Mathematics and Computer Science Emory University

Chapter 6: Basic Concepts: Association Rules. Basic Concepts: Frequent Patterns. (absolute) support, or, support. (relative) support, s, is the

Frequent Pattern Mining

Chapter 7: Frequent Itemsets and Association Rules

Chapter 4: Association analysis:

On-Line Application Processing

Mining Association Rules in Large Databases

Lecture Topic Projects 1 Intro, schedule, and logistics 2 Data Science components and tasks 3 Data types Project #1 out 4 Introduction to R,

Data warehouses Decision support The multidimensional model OLAP queries

Data Warehousing and Data Mining

Pattern Mining. Knowledge Discovery and Data Mining 1. Roman Kern KTI, TU Graz. Roman Kern (KTI, TU Graz) Pattern Mining / 42

Jarek Szlichta Acknowledgments: Jiawei Han, Micheline Kamber and Jian Pei, Data Mining - Concepts and Techniques

Carnegie Mellon Univ. Dept. of Computer Science /615 DB Applications. Data mining - detailed outline. Problem

CS 245: Database System Principles. Warehousing. Outline. What is a Warehouse? What is a Warehouse? Notes 13: Data Warehousing

Data mining - detailed outline. Carnegie Mellon Univ. Dept. of Computer Science /615 DB Applications. Problem.

DATA WAREHOUING UNIT I

Effectiveness of Freq Pat Mining

CS570 Introduction to Data Mining

CS 6093 Lecture 7 Spring 2011 Basic Data Mining. Cong Yu 03/21/2011

Chapter 7: Frequent Itemsets and Association Rules

CSE 544 Principles of Database Management Systems. Alvin Cheung Fall 2015 Lecture 8 - Data Warehousing and Column Stores

On-Line Analytical Processing (OLAP) Traditional OLTP

Time: 3 hours. Full Marks: 70. The figures in the margin indicate full marks. Answers from all the Groups as directed. Group A.

Information Integration

ANU MLSS 2010: Data Mining. Part 2: Association rule mining

Association Rules. A. Bellaachia Page: 1

Warehousing. Data Mining

Data Warehousing and Decision Support

Oracle 1Z0-515 Exam Questions & Answers

Data Warehousing Conclusion. Esteban Zimányi Slides by Toon Calders

Question Bank. 4) It is the source of information later delivered to data marts.

Data Warehousing and Decision Support

Data Mining Concepts & Techniques

Data Mining & Data Warehouse

Data Warehousing and OLAP

What Is Data Mining? CMPT 354: Database I -- Data Mining 2

Market baskets Frequent itemsets FP growth. Data mining. Frequent itemset Association&decision rule mining. University of Szeged.

Data Warehousing and Decision Support. Introduction. Three Complementary Trends. [R&G] Chapter 23, Part A

DATA MINING TRANSACTION

Overview. Introduction to Data Warehousing and Business Intelligence. BI Is Important. What is Business Intelligence (BI)?

Data Warehouse and Data Mining

Lectures for the course: Data Warehousing and Data Mining (IT 60107)

Frequent Pattern Mining

GUJARAT TECHNOLOGICAL UNIVERSITY MASTER OF COMPUTER APPLICATIONS (MCA) Semester: IV

Association Rules. Berlin Chen References:

PESIT- Bangalore South Campus Hosur Road (1km Before Electronic city) Bangalore

Table of Contents. Knowledge Management Data Warehouses and Data Mining. Introduction and Motivation

Knowledge Management Data Warehouses and Data Mining

Data Structures. Notes for Lecture 14 Techniques of Data Mining By Samaher Hussein Ali Association Rules: Basic Concepts and Application

Most database operations involve On- Line Transaction Processing (OTLP).

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

Data Warehouses. Yanlei Diao. Slides Courtesy of R. Ramakrishnan and J. Gehrke

Big Trend in Business Intelligence: Data Mining over Big Data Web Transaction Data. Fall 2012

Chapter 1, Introduction

SQL Server Analysis Services

Association rules. Marco Saerens (UCL), with Christine Decaestecker (ULB)

Mining Frequent Patterns without Candidate Generation

CSE 544 Principles of Database Management Systems. Fall 2016 Lecture 14 - Data Warehousing and Column Stores

DATA MINING II - 1DL460

Performance and Scalability: Apriori Implementa6on

Data Mining: Concepts and Techniques. Chapter 5. SS Chung. April 5, 2013 Data Mining: Concepts and Techniques 1

Decision Support. Chapter 25. CS 286, UC Berkeley, Spring 2007, R. Ramakrishnan 1

2 CONTENTS

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

Data Warehousing & OLAP

Data Mining. Ryan Benton Center for Advanced Computer Studies University of Louisiana at Lafayette Lafayette, La., USA.

Data Warehouse and Data Mining

OLAP Introduction and Overview

Data warehouse and Data Mining

Decision Support, Data Warehousing, and OLAP


Association Rule Mining. Entscheidungsunterstützungssysteme

Data Warehousing and Decision Support (mostly using Relational Databases) CS634 Class 20

Data Mining. Associate Professor Dr. Raed Ibraheem Hamed. University of Human Development, College of Science and Technology

This tutorial will help computer science graduates to understand the basic-to-advanced concepts related to data warehousing.

Efficient Computation of Data Cubes. Network Database Lab

1Z0-526

This tutorial has been prepared for computer science graduates to help them understand the basic-to-advanced concepts related to data mining.

Database design View Access patterns Need for separate data warehouse:- A multidimensional data model:-

2. Discovery of Association Rules

Fig 1.2: Relationship between DW, ODS and OLTP Systems

Table Of Contents: xix Foreword to Second Edition

Reading Material. Data Mining - 2. Data Mining - 1. OLAP vs. Data Mining 11/19/17. Four Main Steps in KD and DM (KDD) CompSci 516: Database Systems

Code No: R Set No. 1

Frequent Pattern Mining S L I D E S B Y : S H R E E J A S W A L

Information Management course

Decision Support Systems aka Analytical Systems

The University of Iowa Intelligent Systems Laboratory The University of Iowa Intelligent Systems Laboratory

Evolving To The Big Data Warehouse

AN IMPROVISED FREQUENT PATTERN TREE BASED ASSOCIATION RULE MINING TECHNIQUE WITH MINING FREQUENT ITEM SETS ALGORITHM AND A MODIFIED HEADER TABLE

Contents. Foreword to Second Edition. Acknowledgments About the Authors

Association Rules Outline

CHAPTER 8 DECISION SUPPORT V2 ADVANCED DATABASE SYSTEMS. Assist. Prof. Dr. Volkan TUNALI

A Novel Approach of Data Warehouse OLTP and OLAP Technology for Supporting Management prospective

TIM 50 - Business Information Systems

Transcription:

Data Warehousing & Mining CPS 116 Introduction to Database Systems Data integration 2 Data resides in many distributed, heterogeneous OLTP (On-Line Transaction Processing) sources Sales, inventory, customer, NC branch, NY branch, CA branch, Need to support OLAP (On-Line Analytical Processing) over an integrated view of the data Possible approaches to integration Eager: integrate in advance and store the integrated data at a central repository called the data warehouse Lazy: integrate on demand; process queries over distributed sources mediated or federated systems OLTP versus OLAP 3 OLTP OLAP Mostly updates Mostly reads Short, simple transactions Long, complex queries Clerical users Analysts, decision makers Goal: ACID, transaction Goal: fast queries throughput Implications on database design and optimization?

Eager versus lazy integration 4 Eager (warehousing) In advance: before queries Copy data from sources Lazy On demand: at query time Leave data at sources Maintaining a data warehouse 5 The ETL process Extraction: extract relevant data and/or changes from sources Transformation: transform data to match the warehouse schema Loading: integrate data/changes into the warehouse Approaches Recomputation Easy to implement; just take periodic dumps of the sources, say, every night What if there is no night, e.g., a global organization? What if recomputation takes more than a day? Incremental maintenance Compute and apply only incremental changes; fast if changes are small Not easy to do for complicated transformations Need to detect incremental changes at the sources Star schema of a data warehouse Dimension table PID name cost p1 beer 10 p2 diaper 16......... Dimension table SID city s1 Durham s2 Chapel Hill s3 RTP...... 6 Sale OID date CID PID SID qty price 100 11/23/2001 c3 p1 s1 1 12 102 12/12/2001 c3 p2 s1 2 17 105 12/24/2001 c5 p1 s3 5 13..................... CID name address city c3 Amy 100 Main St. Durham c4 Ben 102 Main St. Durham c5 Coy 800 Eighth St. Durham............ Dimension table Small Updated infrequently Fact table Big Constantly growing s measures (often aggregated in queries)

Data cube 7 Simplified schema: Sale (CID, PID, SID, qty) (c5, p1, s3) = 5 p2 p1 s1 s2 s3 (c3, p2, s1) = 2 (c3, p1, s1) = 1 (c5, p1, s1) = 3 ALL c3 c4 c5 Completing the cube plane 8 Total quantity of sales for each product in each store SELECT PID, SID, SUM(qty) FROM Sale PID, SID; (c5, p1, s3) = 5 (ALL, p1, s3) = 5 (ALL, p2, s1) = 2 (c3, p2, s1) = 2 p2 (ALL, p1, s1) = 4 s3 (c3, p1, s1) = 1 (c5, p1, s1) = 3 s2 p1 s1 Project all points onto - plane ALL c3 c4 c5 Completing the cube axis 9 Total quantity of sales for each product SELECT PID, SUM(qty) FROM Sale PID; (c5, p1, s3) = 5 (ALL, p1, s3) = 5 (ALL, p2, s1) = 2 (c3, p2, s1) = 2 (ALL, p2, ALL) = 2 p2 (ALL, p1, s1) = 4 s3 (c3, p1, s1) = 1 (c5, p1, s1) = 3 s2 (ALL, p1, ALL) = 9 p1 s1 Further project points onto axis ALL c3 c4 c5

Completing the cube origin 10 Total quantity of sales SELECT SUM(qty) FROM Sale; (c5, p1, s3) = 5 (ALL, p1, s3) = 5 (ALL, p2, s1) = 2 (c3, p2, s1) = 2 (ALL, p2, ALL) = 2 p2 (ALL, p1, s1) = 4 s3 (c3, p1, s1) = 1 (c5, p1, s1) = 3 s2 (ALL, p1, ALL) = 9 p1 s1 Further project points onto the origin ALL (ALL, ALL, ALL) = 11 c3 c4 c5 CUBE operator 11 Sale (CID, PID, SID, qty) Proposed SQL extension: SELECT SUM(qty) FROM Sale CUBE CID, PID, SID; Output contains: Normal groups produced by (c1, p1, s1, sum), (c1, p2, s3, sum), etc. Groups with one or more ALL s (ALL, p1, s1, sum), (c2, ALL, ALL, sum), (ALL, ALL, ALL, sum), etc. Can you write a CUBE query using only s? Gray et al., Data Cube: A Relational Aggregation Operator Generalizing Group-By, Cross-Tab, and Sub-Total. ICDE 1996 Automatic summary tables 12 Computing and CUBE aggregates is expensive OLAP queries perform these operations over and over again Idea: precompute and store the aggregates as automatic summary tables (a DB2 term) Maintained automatically as base data changes Same as materialized views

Aggregation view lattice 13 Roll up CID PID SID Drill down CID, PID CID, SID CID, PID, SID PID, SID A parent can be computed from any child Selecting views to materialize 14 Factors in deciding what to materialize What is its storage cost? What is its update cost? Which queries can benefit from it? How much can a query benefit from it? Example is small, but not useful to most queries CID, PID, SID is useful to any query, but too large to be beneficial Harinarayan et al., Implementing Data Cubes Efficiently. SIGMOD 1996 Data mining 15 Data knowledge DBMS meets AI and statistics Clustering, prediction (classification and regression), association analysis, outlier analysis, evolution analysis, etc. Usually complex statistical queries that are difficult to answer often specialized algorithms outside DBMS We will focus on frequent itemset mining

Mining frequent itemsets 16 Given: a large database of transactions, each containing a set of items Example: market baskets Find all frequent itemsets A set of items X is frequent if no less than s min % of all transactions contain X Examples: {diaper, beer}, {scanner, color printer} T001 diaper, milk, candy T002 milk, egg T003 milk, beer T004 diaper, milk, egg T005 diaper, beer T006 milk, beer T007 diaper, beer T008 diaper, milk, beer, candy T009 diaper, milk, beer...... First try 17 A naïve algorithm Keep a running count for each possible itemset For each transaction T, and for each itemset X, if T contains X then increment the count for X Return itemsets with large enough counts Problem: Think: How do we prune the search space? The Apriori property 18 All subsets of a frequent itemset must also be frequent Because any transaction that contains X must also contains subsets of X If we have already verified that X is infrequent, there is no need to count X s supersets because they must be infrequent too

The Apriori algorithm 19 Multiple passes over the transactions Pass k finds all frequent k-itemsets (itemset of size k) Use the set of frequent k-itemsets found in pass k to construct candidate (k+1)-itemsets to be counted in pass (k+1) A (k+1)-itemset is a candidate only if all its subsets of size k are frequent Example: pass 1 20 T001 A, B, E T002 B, D T003 B, C T004 A, B, D T005 A, C T006 B, C T007 A, C T008 A, B, C, E T009 A, B, C T010 F Transactions s min % = 20% 1-itemsets {A} 6 {B} 7 {C} 6 {D} 2 {E} 2 (Itemset {F} is infrequent) Example: pass 2 21 T001 A, B, E T002 B, D T003 B, C T004 A, B, D T005 A, C T006 B, C T007 A, C T008 A, B, C, E T009 A, B, C T010 F Transactions s min % = 20% Generate candidates {A} 6 {B} 7 {C} 6 {D} 2 {E} 2 1-itemsets Scan and count itemset count {A,B} 4 {A,C} 4 {A,D} 1 {A,E} 2 {B,C} 4 {B,D} 2 {B,E} 2 {C,D} 0 {C,E} 1 {D,E} 0 Candidate 2-itemsets Check min. support {A,B} 4 {A,C} 4 {A,E} 2 {B,C} 4 {B,D} 2 {B,E} 2 2-itemsets

Example: pass 3 22 T001 A, B, E T002 B, D T003 B, C T004 A, B, D T005 A, C T006 B, C T007 A, C T008 A, B, C, E T009 A, B, C T010 F Transactions s min % = 20% Generate candidates {A,B} 4 {A,C} 4 {A,E} 2 {B,C} 4 {B,D} 2 {B,E} 2 2-itemsets Scan and count {A,B,C} 2 {A,B,E} 2 Candidate 3-itemsets Check min. support {A,B,C} 2 {A,B,E} 2 3-itemsets Example: pass 4 23 T001 A, B, E T002 B, D T003 B, C T004 A, B, D T005 A, C T006 B, C T007 A, C T008 A, B, C, E T009 A, B, C T010 F Transactions s min % = 20% Generate candidates {A,B,C} 2 {A,B,E} 2 3-itemsets itemset count Candidate 4-itemsets No more itemsets to count! Example: final answer 24 {A} 6 {B} 7 {C} 6 {D} 2 {E} 2 1-itemsets {A,B} 4 {A,C} 4 {A,E} 2 {B,C} 4 {B,D} 2 {B,E} 2 2-itemsets {A,B,C} 2 {A,B,E} 2 3-itemsets