Download presentation
Presentation is loading. Please wait.
1
© Tan,Steinbach, Kumar Introduction to Data Mining 8/05/2005 1 Data Warehouse and Data Cube Lecture Notes for Chapter 3 Introduction to Data Mining By Tan, Steinbach, Kumar And Data Mining, by Han and Kamber, 2 nd Edition Revised by QY
2
© Tan,Steinbach, Kumar Introduction to Data Mining 8/05/2005 2 OLAP l On-Line Analytical Processing (OLAP) was proposed by E. F. Codd, the father of the relational database. l Relational databases put data into tables, while OLAP uses a multidimensional array representation. –Such representations of data previously existed in statistics and other fields l There are a number of data analysis and data exploration operations that are easier with such a data representation.
3
© Tan,Steinbach, Kumar Introduction to Data Mining 8/05/2005 3 Creating a Multidimensional Array l Two key steps in converting tabular data into a multidimensional array. –First, identify which attributes are to be the dimensions and which attribute is to be the target attribute whose values appear as entries in the multidimensional array. The attributes used as dimensions must have discrete values The target value is typically a count or continuous value, e.g., the cost of an item Can have no target variable at all except the count of objects that have the same set of attribute values –Second, find the value of each entry in the multidimensional array by summing the values (of the target attribute) or count of all objects that have the attribute values corresponding to that entry.
4
© Tan,Steinbach, Kumar Introduction to Data Mining 8/05/2005 4 Example: Iris data l We show how the attributes, petal length, petal width, and species type can be converted to a multidimensional array: from iris data http://archive.ics.uci.edu/ml/datasets/Iris http://archive.ics.uci.edu/ml/datasets/Iris –First, we discretized the petal width and length to have categorical values: low, medium, and high
5
© Tan,Steinbach, Kumar Introduction to Data Mining 8/05/2005 5 Example: Iris data (continued) l Each unique tuple of petal width, petal length, and species type identifies one element of the array. l This element is assigned the corresponding count value. l The figure illustrates the result. l All non-specified tuples are 0. Length
6
© Tan,Steinbach, Kumar Introduction to Data Mining 8/05/2005 6 OLAP Operations: Data Cube l The key operation of a OLAP is the formation of a data cube –A data cube is a multidimensional representation of data, together with all possible aggregates. –Aggregates: similar to class attribute result by selecting a proper subset of the dimensions and summing over all remaining dimensions. Cached to improve speed and support online computation –For example, if we choose the species type dimension of the Iris data and –sum over all other dimensions, –the result will be a one-dimensional entry with three entries, –each of which gives the number of flowers of each type.
7
© Tan,Steinbach, Kumar Introduction to Data Mining 8/05/2005 7 June 29, 2015Data Mining: Concepts and Techniques 7 From Tables and Spreadsheets to Data Cubes l A data warehouse is based on a multidimensional data model which views data in the form of a data cube l A data cube, such as sales, allows data to be modeled and viewed in multiple dimensions –Dimension tables, such as item (item_name, brand, type), or time(day, week, month, quarter, year) –Fact table contains measures (such as dollars_sold) and keys to each of the related dimension tables
8
© Tan,Steinbach, Kumar Introduction to Data Mining 8/05/2005 8 June 29, 2015Data Mining: Concepts and Techniques 8 Cube: A Lattice of Cuboids time,item time,item,location time, item, location, supplier all timeitemlocationsupplier time,location time,supplier item,location item,supplier location,supplier time,item,supplier time,location,supplier item,location,supplier 0-D(apex) cuboid 1-D cuboids 2-D cuboids 3-D cuboids 4-D(base) cuboid
9
© Tan,Steinbach, Kumar Introduction to Data Mining 8/05/2005 9 June 29, 2015Data Mining: Concepts and Techniques 9 A Concept Hierarchy: Dimension (location) all EuropeNorth_America MexicoCanadaSpainGermany Vancouver M. WindL. Chan... all region office country TorontoFrankfurtcity
10
© Tan,Steinbach, Kumar Introduction to Data Mining 8/05/2005 10 June 29, 2015Data Mining: Concepts and Techniques 10 A Sample Data Cube Total annual sales of TV in U.S.A. Date Product Country sum TV VCR PC 1Qtr 2Qtr 3Qtr 4Qtr U.S.A Canada Mexico sum
11
© Tan,Steinbach, Kumar Introduction to Data Mining 8/05/2005 11 June 29, 2015Data Mining: Concepts and Techniques 11 Cuboids Corresponding to the Cube all product date country product,dateproduct,countrydate, country product, date, country 0-D(apex) cuboid 1-D cuboids 2-D cuboids 3-D(base) cuboid
12
© Tan,Steinbach, Kumar Introduction to Data Mining 8/05/2005 12 l The following figure table shows one of the two dimensional aggregates, along with two of the one-dimensional aggregates, and the overall total Data Cube Example (continued)
13
© Tan,Steinbach, Kumar Introduction to Data Mining 8/05/2005 13 OLAP Operations: Slicing and Dicing l Slicing is selecting a group of cells from the entire multidimensional array by specifying a specific value for one or more dimensions. l Dicing involves selecting a subset of cells by specifying a range of attribute values. –This is equivalent to defining a subarray from the complete array. l In practice, both operations can also be accompanied by aggregation over some dimensions.
14
© Tan,Steinbach, Kumar Introduction to Data Mining 8/05/2005 14 OLAP Operations: Roll-up and Drill-down l This hierarchical structure gives rise to the roll-up and drill-down operations. –For sales data, we can aggregate (roll up) the sales across all the dates in a month. –Conversely, given a view of the data where the time dimension is broken into months, we could split the monthly sales totals (drill down) into daily sales totals. –Likewise, we can drill down or roll up on the location or product ID attributes.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.