数据挖掘课件_第1页
数据挖掘课件_第2页
数据挖掘课件_第3页
数据挖掘课件_第4页
数据挖掘课件_第5页
已阅读5页,还剩105页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Data Warehousing and OLAP TechnologySchool of Software, Nanjing UniversityKnowledge Discovery in DatabasesData Warehousing and OLAP TechnologyWhat is a data warehouse? A multi-dimensional data modelData warehouse architectureData warehouse implementationFurther development of data cube technologyFro

2、m data warehousing to data miningWhat is Data Warehouse?Defined in many different ways, but not rigorously.A decision support database that is maintained separately from the organizations operational databaseSupport information processing by providing a solid platform of consolidated, historical dat

3、a for analysis.“A data warehouse is a subject-oriented, integrated, time-variant, and nonvolatile collection of data in support of managements decision-making process.”W. H. InmonData warehousing:The process of constructing and using data warehousesData WarehouseSubject-OrientedOrganized around majo

4、r subjects, such as customer, product, sales.Focusing on the modeling and analysis of data for decision makers, not on daily operations or transaction processing.Provide a simple and concise view around particular subject issues by excluding data that are not useful in the decision support process.D

5、ata WarehouseIntegratedConstructed by integrating multiple, heterogeneous data sourcesRelational databases, flat files, on-line transaction recordsData cleaning and data integration techniques are applied.Ensure consistency in naming conventions, encoding structures, attribute measures, etc. among d

6、ifferent data sourcesE.g., Hotel price: currency, tax, breakfast covered, etc.When data is moved to the warehouse, it is converted. Data WarehouseTime VariantThe time horizon for the data warehouse is significantly longer than that of operational systems.Operational database: current value data.Data

7、 warehouse data: provide information from a historical perspective (e.g., past 5-10 years)Every key structure in the data warehouseContains an element of time, explicitly or implicitlyBut the key of operational data may or may not contain “time element”.Data WarehouseNon-VolatileA physically separat

8、e store of data transformed from the operational environment.Operational update of data does not occur in the data warehouse environment.Does not require transaction processing, recovery, and concurrency control mechanismsRequires only two operations in data accessing: initial loading of data and ac

9、cess of data.Data Warehouse vs. Heterogeneous DBMSTraditional heterogeneous DB integration: Build wrappers/mediators on top of heterogeneous databases Query driven approachWhen a query is posed to a client site, a meta-dictionary is used to translate the query into queries appropriate for individual

10、 heterogeneous sites involved, and the results are integrated into a global answer setComplex information filtering, compete for resourcesData warehouse: update-driven, high performanceInformation from heterogeneous sources is integrated in advance and stored in warehouses for direct query and analy

11、sisData Warehouse vs. Operational DBMSOLTP (On-Line Transaction Processing)Major task of traditional relational DBMSDay-to-day operations: purchasing, inventory, banking, manufacturing, payroll, registration, accounting, etc.OLAP (On-Line Analytical Processing)Major task of data warehouse systemData

12、 analysis and decision makingDistinct features (OLTP vs. OLAP):User and system orientation: customer vs. marketData contents: current, detailed vs. historical, consolidatedDatabase design: ER + application vs. star + subjectView: current, local vs. evolutionary, integratedAccess patterns: update vs.

13、 read-only but complex queriesOLTP vs. OLAPWhy Separate Data Warehouse?High performance for both systemsDBMS tuned for OLTP: access methods, indexing, concurrency control, recoveryWarehousetuned for OLAP: complex OLAP queries, multidimensional view, consolidation.Different functions and different da

14、ta:missing data: Decision support requires historical data which operational DBs do not typically maintaindata consolidation: DS requires consolidation (aggregation, summarization) of data from heterogeneous sourcesdata quality: different sources typically use inconsistent data representations, code

15、s and formats which have to be reconciledData Warehousing and OLAP TechnologyWhat is a data warehouse? A multi-dimensional data modelData warehouse architectureData warehouse implementationFurther development of data cube technologyFrom data warehousing to data miningFrom Tables and Spreadsheets to

16、Data CubesA data warehouse is based on a multidimensional data model which views data in the form of a data cubeA data cube, such as sales, allows data to be modeled and viewed in multiple dimensionsDimension tables, such as item (item_name, brand, type), or time(day, week, month, quarter, year) Fac

17、t table contains measures (such as dollars_sold) and keys to each of the related dimension tablesMulti-Dimensional Data Model(Cube)Total annual salesof TV in U.S.A.DateProductCountryAll, All, Allsumsum TVVCRPC1Qtr2Qtr3Qtr4QtrU.S.ACanadaMexicosumCube: A Lattice of Cuboids(I)allproductdatecountryprodu

18、ct,dateproduct,countrydate, countryproduct, date, country0-D(apex) cuboid1-D cuboids2-D cuboids3-D(base) cuboidIn data warehousing literature, an n-D base cube is called a base cuboid. The top most 0-D cuboid, which holds the highest-level of summarization, is called the apex cuboid. The lattice of

19、cuboids forms a data cube.Cube: A Lattice of Cuboids(II)alltimeitemlocationsuppliertime,itemtime,locationtime,supplieritem,locationitem,supplierlocation,suppliertime,item,locationtime,item,suppliertime,location,supplieritem,location,suppliertime, item, location, supplier0-D(apex) cuboid1-D cuboids2-

20、D cuboids3-D cuboids4-D(base) cuboidConceptual Modeling of Data WarehousesModeling data warehouses: dimensions & measuresStar schema: A fact table in the middle connected to a set of dimension tables Snowflake schema: A refinement of star schema where some dimensional hierarchy is normalized into a

21、set of smaller dimension tables, forming a shape similar to snowflakeFact constellations: Multiple fact tables share dimension tables, viewed as a collection of stars, therefore called galaxy schema or fact constellation DefinitionExample of Star Schema time_keydayday_of_the_weekmonthquarteryeartime

22、location_keystreetcityprovince_or_statecountrylocationSales Fact Table time_key item_key branch_key location_key units_sold dollars_sold avg_salesMeasuresitem_keyitem_namebrandtypesupplier_typeitembranch_keybranch_namebranch_typebranchDefinitionExample of Snowflake Schematime_keydayday_of_the_weekmo

23、nthquarteryeartimelocation_keystreetcity_keylocationSales Fact Table time_key item_key branch_key location_key units_sold dollars_sold avg_salesMeasuresitem_keyitem_namebrandtypesupplier_keyitembranch_keybranch_namebranch_typebranchsupplier_keysupplier_typesuppliercity_keycityprovince_or_statecountr

24、ycityDefinitionExample of Fact Constellationtime_keydayday_of_the_weekmonthquarteryeartimelocation_keystreetcityprovince_or_statecountrylocationSales Fact Tabletime_key item_key branch_key location_key units_sold dollars_sold avg_salesMeasuresitem_keyitem_namebrandtypesupplier_typeitembranch_keybran

25、ch_namebranch_typebranchShipping Fact Tabletime_key item_key shipper_key from_location to_location dollars_cost units_shippedshipper_keyshipper_namelocation_keyshipper_typeshipperA Data Mining Query Language, DMQLCube Definition (Fact Table)define cube : Dimension Definition ( Dimension Table )defin

26、e dimension as ()Special Case (Shared Dimension Tables)First time as “cube definition”define dimension as in cube define cube sales_star time, item, branch, location:dollars_sold = sum(sales_in_dollars), avg_sales = avg(sales_in_dollars), units_sold = count(*)define dimension time as (time_key, day,

27、 day_of_week, month, quarter, year)define dimension item as (item_key, item_name, brand, type, supplier_type)define dimension branch as (branch_key, branch_name, branch_type)define dimension location as (location_key, street, city, province_or_state, country)Figure Defining a Star Schema in DMQLFigu

28、re Defining a Snowflake Schema in DMQLdefine cube sales_snowflake time, item, branch, location:dollars_sold = sum(sales_in_dollars), avg_sales = avg(sales_in_dollars), units_sold = count(*)define dimension time as (time_key, day, day_of_week, month, quarter, year)define dimension item as (item_key,

29、item_name, brand, type, supplier(supplier_key, supplier_type)define dimension branch as (branch_key, branch_name, branch_type)define dimension location as (location_key, street, city(city_key, province_or_state, country)Figure Defining a Fact Constellation in DMQLdefine cube sales time, item, branch

30、, location:dollars_sold = sum(sales_in_dollars), avg_sales = avg(sales_in_dollars), units_sold = count(*)define dimension time as (time_key, day, day_of_week, month, quarter, year)define dimension item as (item_key, item_name, brand, type, supplier_type)define dimension branch as (branch_key, branch

31、_name, branch_type)define dimension location as (location_key, street, city, province_or_state, country)define cube shipping time, item, shipper, from_location, to_location:dollar_cost = sum(cost_in_dollars), unit_shipped = count(*)define dimension time as time in cube salesdefine dimension item as

32、item in cube salesdefine dimension shipper as (shipper_key, shipper_name, location as location in cube sales, shipper_type)define dimension from_location as location in cube salesdefine dimension to_location as location in cube salesMeasures: Three Categoriesdistributive: if the result derived by ap

33、plying the function to n aggregate values is the same as that derived by applying the function on all the data without partitioning.E.g., count(), sum(), min(), max().algebraic: if it can be computed by an algebraic function with M arguments (where M is a bounded integer), each of which is obtained

34、by applying a distributive aggregate function.E.g., avg(), standard_deviation().holistic: if there is no constant bound on the storage size needed to describe a subaggregate. E.g., median(), mode(), rank().A Concept Hierarchy: Dimension (location)allEuropeNorth_AmericaMexicoCanadaSpainGermanyVancouv

35、erM. WindL. Chan.allregionofficecountryTorontoFrankfurtcityMultidimensional DataSales volume as a function of product, month, and regionProductRegionMonthDimensions: Product, Location, TimeHierarchical summarization pathsIndustry Region YearCategory Country QuarterProduct City Month Week Office DayA

36、 Sample Data Cube(I)Total annual salesof TV in U.S.A.DateProductCountryAll, All, Allsumsum TVVCRPC1Qtr2Qtr3Qtr4QtrU.S.ACanadaMexicosumA Sample Data Cube(II)Browsing a Data CubeVisualizationOLAP capabilitiesInteractive manipulationTypical OLAP OperationsRoll up (drill-up): summarize databy climbing u

37、p hierarchy or by dimension reductionDrill down (roll down): reverse of roll-upfrom higher level summary to lower level summary or detailed data, or introducing new dimensionsSlice and dice: project and select Pivot (rotate): reorient the cube, visualization, 3D to series of 2D planes.Other operatio

38、nsdrill across: involving (across) more than one fact tabledrill through: through the bottom level of the cube to its back-end relational tables (using SQL)Typical OLAP Operations Roll-upRoll up on location(from cities to countries)ChicagoNew YorkMontrealVancouverLocation(Cities)Q1Q2Q3Q4Item (types)

39、Home entertainmentcomputerphonesecurityUSCanadaLocation(Countries)Q1Q2Q3Q4Item (types)Home entertainmentcomputerphonesecurityTime (Quarters)Time (Quarters)Typical OLAP Operations Drill-downDrill downon time(from quaters to months)ChicagoNew YorkMontrealVancouverLocation(Cities)Q1Q2Q3Q4Item (types)Ho

40、me entertainmentcomputerphonesecurityLocation(Cities)JanFebMarAprMayJunJulAugSepOctNovDecItem (types)Home entertainmentcomputerphonesecurityChicagoNew YorkMontrealVancouverTime (Quarters)Time (months)Typical OLAP Operations SliceChicagoNew YorkMontrealVancouverLocation(Cities)Time (Quarters)Q1Q2Q3Q4

41、Item (types)Home entertainmentcomputerphonesecuritySlice for time = Q1Location(Cities)ChicagoNew YorkMontrealVancouverItem (types)Home entertainmentcomputerphonesecurityTypical OLAP Operations DiceChicagoNew YorkMontrealLocation(Cities)Q1Q2Q3Q4Item (types)Home entertainmentcomputerphonesecurityDice

42、for (location = Montreal or Vancouver) and (time=Q1 or Q2) and (item=home entertainment or computer)Q1Q2Location(Cities)MontrealVancouverHome entertainmentcomputerVancouverItem (types)Time (Quarters)Typical OLAP Operations Pivot(Rotate)Location(Cities)ChicagoNew YorkMontrealVancouverItem (types)Home

43、 entertainmentcomputerphonesecurityLocation(Cities)ChicagoNew YorkMontrealVancouverItem (types)Home entertainmentcomputerphonesecurityA Star-Net Query Model Shipping MethodAIR-EXPRESSTRUCKORDERCustomer OrdersCONTRACTSCustomerProductPRODUCT GROUPPRODUCT LINEPRODUCT ITEMSALES PERSONDISTRICTDIVISIONOrg

44、anizationPromotionCITYCOUNTRYREGIONLocationDAILYQTRLYANNUALYTimeEach circle is called a footprintData Warehousing and OLAP TechnologyWhat is a data warehouse? A multi-dimensional data modelData warehouse architectureData warehouse implementationFurther development of data cube technologyFrom data wa

45、rehousing to data miningDataWarehouseExtractTransformLoadRefreshOLAP EngineAnalysisQueryReportsData miningMonitor&IntegratorMetadataData SourcesFront-End ToolsServeData MartsOperational DBsothersourcesData StorageOLAP ServerMulti-Tiered ArchitectureThree Data Warehouse ModelsEnterprise warehousecoll

46、ects all of the information about subjects spanning the entire organizationData Marta subset of corporate-wide data that is of value to a specific groups of users. Its scope is confined to specific, selected groups, such as marketing data martIndependent vs. dependent (directly from warehouse) data

47、martVirtual warehouseA set of views over operational databasesOnly some of the possible summary views may be materializedData Warehouse Development: A Recommended ApproachDefine a high-level corporate data modelData MartData MartDistributed Data MartsMulti-Tier Data WarehouseEnterprise Data Warehous

48、eModel refinementModel refinementOLAP Server ArchitecturesRelational OLAP (ROLAP) Use relational or extended-relational DBMS to store and manage warehouse data and OLAP middleware to support missing piecesInclude optimization of DBMS backend, implementation of aggregation navigation logic, and addit

49、ional tools and servicesgreater scalabilityMultidimensional OLAP (MOLAP) Array-based multidimensional storage engine (sparse matrix techniques)fast indexing to pre-computed summarized dataHybrid OLAP (HOLAP)User flexibility, e.g., low level: relational, high-level: arraySpecialized SQL serversspecia

50、lized support for SQL queries over star/snowflake schemasData Warehousing and OLAP TechnologyWhat is a data warehouse? A multi-dimensional data modelData warehouse architectureData warehouse implementationData Warehouse DesignOLAP Modeling MethodsOptimization of Logical Model/Physical ModelEfficient

51、 Methods for Data Cube ComputationPlan and Implementation of Data WarehouseFurther development of data cube technologyFrom data warehousing to data mining数据仓库设计数据仓库设计和数据库设计的差异面向需求不同:数据库面向具体应用,需求一开始就很明确,而数据仓库是一个渐进的过程设计目标不同:OLTP vs. OLAP处理类型不同:面向操作型应用 vs. 面向分析型应用数据来源不同:业务员输入 vs. 已存在的业务系统数据系统设计的方法不同:数据

52、仓库可以采用“数据驱动”的设计方法数据仓库设计可以分为数据仓库模型设计和数据装载接口设计两部分 数据仓库的设计步骤将企业模型映射到数据仓库系统的过程分析建立企业模型并映射到 数据仓库概念模型逻辑模型设计物理模型设计客观世界概念模型逻辑模型物理模型关系模型客观世界到主观世界的映射物理实现的细节Data Warehousing and OLAP TechnologyWhat is a data warehouse? A multi-dimensional data modelData warehouse architectureData warehouse implementationData w

53、arehouse DesignOLAP Modeling MethodsOptimization of Logical Model/Physical ModelEfficient Methods for Data Cube ComputationPlan and Implementation of Data WarehouseFurther development of data cube technologyFrom data warehousing to data miningOLAP建模方法维表设计维的变化维表的共享层次信息和分类信息的位置事实表设计事实表的特性通用数据和专用数据事实表维

54、表的变化(一)维表通过记录因素的属性描述事件中包含的诸多因素维表的本质是多维分析空间在某个角度上的投影由于维表描述的是事物的属性,因此随着事物本身的变化,其属性也会产生改变如果该属性与决策没有太大关系,例如电话号码属性对于分析顾客购买行为没有什么作用,则此属性的变化可以忽略不计如果该属性与决策有关,例如某位顾客搬家后离超市更远了,我们试图分析其购买行为与家里距离变远有何关系,则不能将之忽略维表的变化(二)对于需要记录其改变的维,有若干方法可以进行处理当属性进行变化时,创建一个新记录例如:缺点:由于ID产生变化,被认为是两条记录创建一个新的字段,将新地址填入例如:缺点:可扩展性不佳增加一个修订号

55、码字段和当前标记字段例如:缺点:维表和事实表连接时需要采用“主关键字”“修订号码”,增加了事实表的复杂性345顾客A东城区368顾客A西城区345顾客A东城区西城区3450过往东城区3451当前西城区维表的变化(三)最为理想的解决方案新建一个关键字客户ID,通过主关键字与之相连,使用时间字段标志当前的值缺点:相对较为复杂34519987过往海淀区34520031当前西城区34519993过往东城区维表的共享多个维表中可能包含相同的属性:供货商维中包含地址维,而销售商维中可能也包含地址维,因而可能共享维表由于数据仓库中时间维的重要性,各个维中都有可能包含时间维,因而可能共享时间维表可以采用扩展的

56、星座结构来描述共享维表具体内容请参见上节层次信息的位置(一)将维层次信息放入事实表优点:计算极为方便缺点:事实表会因此变得极为庞大层次信息的位置(二)将维层次放在各自的维表中,通过主关键字与事实表相连优点:减少了事实表的大小缺点:OLAP性能比上一种方式差分类信息的位置(一)在事实表中体现维分类优点: OLAP性能好缺点: 事实表的字段数和记录数增加分类信息的位置(二)在维表中体现维分类事实表的特征与维表相比,事实表具有以下特征:记录数量非常多除了度量外,其他字段都是维表或者中间维表(雪花模型)的关键字如果事实相关的维度很多,则事实表的字段数也会比较多因此应当尽量减小一条记录的长度,才能避免事

57、实表过大而难于管理数据的粒度是影响事实表大小的关键因素,因而必须认真设计通用数据和专用数据事实表对应一个问题通常采用一个事实表,但在特殊情况下,也允许采用多个事实表例如:超市里出售多种商品,由于商品本身分类不同,因此所采用的量度可能也不相同如果将这些量度全部置于一个事实表中,由于某种类型的商品的量度其他商品可能不具备,因此则不可避免将在事实表中造成大量的数据空缺解决办法:采用多个事实表,分为通用数据事实表与专用数据事实表加以管理通用数据和专用数据事实表通用事实表与通用的量度专用用事实表与专有的量度Data Warehousing and OLAP TechnologyWhat is a dat

58、a warehouse? A multi-dimensional data modelData warehouse architectureData warehouse implementationData warehouse DesignOLAP Modeling MethodsOptimization of Logical Model/Physical ModelEfficient Methods for Data Cube ComputationPlan and Implementation of Data WarehouseFurther development of data cub

59、e technologyFrom data warehousing to data mining数据仓库的逻辑模型设计系统数据量估算数据粒度的选择数据的分割表的合理划分去除纯操作数据增加导出字段定义关系模式定义元数据存储定义记录系统数据仓库的逻辑模型设计系统数据量估算设在概念模型中出现的表的个数为N(这些表中应不包含不会放进数据仓库的表),对于每个表i( ), 计算表的大小Si和表的主关键字大小Ki,然后估计每张表i 在单位时间内最大记录数Lmax和最少记录数Lmin,则数据仓库的粗略数据量在以下范围:其中,T是数据在数据仓库中存在的周期。 是考虑由于数据冗余和数据索引而使数据量增大的冗余因子

60、,通常取1.22本公式的含义是:数据仓库数据量累加(每张表记录大小每张表主关键字大小)*每张表单位时间内记录的数量*存储时间*冗余因子公式估算出的结果仅能作为参考数据粒度的选择数据量较小的情况下使用单一的数据粒度,即直接存储细节数据并定期在细节数据基础上进行数据综合对于大数据量需要采用双重粒度,对于细节数据只保存近期的数据在数据仓库之中,当保留周期到达时,将距离当前较远的数据导出到磁带或存储设备上综合数据2000/42000/32000/22000/11990/41990/31990/21990/1细节数据单一数据粒度多重数据粒度综合数据细节数据2000/42000/32000/22000/1

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论