ImageVerifierCode 换一换
格式:PPT , 页数:52 ,大小:542.50KB ,
资源ID:379619      下载积分:2000 积分
快捷下载
登录下载
邮箱/手机:
温馨提示:
如需开发票,请勿充值!快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝扫码支付 微信扫码支付   
注意:如需开发票,请勿充值!
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【http://www.mydoc123.com/d-379619.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(Chapter 18- Data Analysis and Mining.ppt)为本站会员(twoload295)主动上传,麦多课文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知麦多课文库(发送邮件至master@mydoc123.com或直接QQ联系客服),我们立即给予删除!

Chapter 18- Data Analysis and Mining.ppt

1、Chapter 18: Data Analysis and Mining,Chapter 18: Data Analysis and Mining,Decision Support Systems Data Analysis and OLAP Data Warehousing Data Mining,Decision Support Systems,Decision-support systems are used to make business decisions, often based on data collected by on-line transaction-processin

2、g systems. Examples of business decisions: What items to stock? What insurance premium to change? To whom to send advertisements? Examples of data used for making decisionsRetail sales transaction detailsCustomer profiles (income, age, gender, etc.),Decision-Support Systems: Overview,Data analysis t

3、asks are simplified by specialized tools and SQL extensions Example tasks For each product category and each region, what were the total sales in the last quarter and how do they compare with the same quarter last year As above, for each product category and each customer category Statistical analys

4、is packages (e.g., : S+) can be interfaced with databases Statistical analysis is a large field, but not covered here Data mining seeks to discover knowledge automatically in the form of statistical rules and patterns from large databases. A data warehouse archives information gathered from multiple

5、 sources, and stores it under a unified schema, at a single site. Important for large businesses that generate data from multiple divisions, possibly at multiple sites Data may also be purchased externally,Data Analysis and OLAP,Online Analytical Processing (OLAP) Interactive analysis of data, allow

6、ing data to be summarized and viewed in different ways in an online fashion (with negligible delay) Data that can be modeled as dimension attributes and measure attributes are called multidimensional data. Measure attributes measure some value can be aggregated upon e.g. the attribute number of the

7、sales relation Dimension attributes define the dimensions on which measure attributes (or aggregates thereof) are viewed e.g. the attributes item_name, color, and size of the sales relation,Cross Tabulation of sales by item-name and color,The table above is an example of a cross-tabulation (cross-ta

8、b), also referred to as a pivot-table. Values for one of the dimension attributes form the row headers Values for another dimension attribute form the column headers Other dimension attributes are listed on top Values in individual cells are (aggregates of) the values of the dimension attributes tha

9、t specify the cell.,Relational Representation of Cross-tabs,Cross-tabs can be represented as relations We use the value all is used to represent aggregates The SQL:1999 standard actually uses null values in place of all despite confusion with regular null values,Data Cube,A data cube is a multidimen

10、sional generalization of a cross-tab Can have n dimensions; we show 3 below Cross-tabs can be used as views on a data cube,Online Analytical Processing,Pivoting: changing the dimensions used in a cross-tab is called Slicing: creating a cross-tab for fixed values only Sometimes called dicing, particu

11、larly when values for multiple dimensions are fixed. Rollup: moving from finer-granularity data to a coarser granularity Drill down: The opposite operation - that of moving from coarser-granularity data to finer-granularity data,Hierarchies on Dimensions,Hierarchy on dimension attributes: lets dimen

12、sions to be viewed at different levels of detail E.g. the dimension DateTime can be used to aggregate by hour of day, date, day of week, month, quarter or year,Cross Tabulation With Hierarchy,Cross-tabs can be easily extended to deal with hierarchies Can drill down or roll up on a hierarchy,OLAP Imp

13、lementation,The earliest OLAP systems used multidimensional arrays in memory to store data cubes, and are referred to as multidimensional OLAP (MOLAP) systems. OLAP implementations using only relational database features are called relational OLAP (ROLAP) systems Hybrid systems, which store some sum

14、maries in memory and store the base data and other summaries in a relational database, are called hybrid OLAP (HOLAP) systems.,OLAP Implementation (Cont.),Early OLAP systems precomputed all possible aggregates in order to provide online response Space and time requirements for doing so can be very h

15、igh 2n combinations of group by It suffices to precompute some aggregates, and compute others on demand from one of the precomputed aggregates Can compute aggregate on (item-name, color) from an aggregate on (item-name, color, size) For all but a few “non-decomposable” aggregates such as median is c

16、heaper than computing it from scratch Several optimizations available for computing multiple aggregates Can compute aggregate on (item-name, color) from an aggregate on (item-name, color, size) Can compute aggregates on (item-name, color, size), (item-name, color) and (item-name) using a single sort

17、ing of the base data,Extended Aggregation in SQL:1999,The cube operation computes union of group bys on every subset of the specified attributes E.g. consider the queryselect item-name, color, size, sum(number) from sales group by cube(item-name, color, size)This computes the union of eight differen

18、t groupings of the sales relation: (item-name, color, size), (item-name, color), (item-name, size), (color, size), (item-name), (color), (size), ( ) where ( ) denotes an empty group by list. For each grouping, the result contains the null value for attributes not present in the grouping.,Extended Ag

19、gregation (Cont.),Relational representation of cross-tab that we saw earlier, but with null in place of all, can be computed byselect item-name, color, sum(number) from sales group by cube(item-name, color) The function grouping() can be applied on an attribute Returns 1 if the value is a null value

20、 representing all, and returns 0 in all other cases. select item-name, color, size, sum(number), grouping(item-name) as item-name-flag, grouping(color) as color-flag, grouping(size) as size-flag, from sales group by cube(item-name, color, size) Can use the function decode() in the select clause to r

21、eplace such nulls by a value such as all E.g. replace item-name in first query by decode( grouping(item-name), 1, all, item-name),Extended Aggregation (Cont.),The rollup construct generates union on every prefix of specified list of attributes E.g. select item-name, color, size, sum(number) from sal

22、es group by rollup(item-name, color, size) Generates union of four groupings: (item-name, color, size), (item-name, color), (item-name), ( ) Rollup can be used to generate aggregates at multiple levels of a hierarchy. E.g., suppose table itemcategory(item-name, category) gives the category of each i

23、tem. Then select category, item-name, sum(number) from sales, itemcategory where sales.item-name = itemcategory.item-name group by rollup(category, item-name)would give a hierarchical summary by item-name and by category.,Extended Aggregation (Cont.),Multiple rollups and cubes can be used in a singl

24、e group by clause Each generates set of group by lists, cross product of sets gives overall set of group by lists E.g., select item-name, color, size, sum(number) from sales group by rollup(item-name), rollup(color, size)generates the groupings item-name, () X (color, size), (color), () = (item-name

25、, color, size), (item-name, color), (item-name), (color, size), (color), ( ) ,Ranking,Ranking is done in conjunction with an order by specification. Given a relation student-marks(student-id, marks) find the rank of each student.select student-id, rank( ) over (order by marks desc) as s-rank from st

26、udent-marks An extra order by clause is needed to get them in sorted orderselect student-id, rank ( ) over (order by marks desc) as s-rank from student-marks order by s-rank Ranking may leave gaps: e.g. if 2 students have the same top mark, both have rank 1, and the next rank is 3 dense_rank does no

27、t leave gaps, so next dense rank would be 2,Ranking (Cont.),Ranking can be done within partition of the data. “Find the rank of students within each section.”select student-id, section, rank ( ) over (partition by section order by marks desc) as sec-rank from student-marks, student-section where stu

28、dent-marks.student-id = student-section.student-id order by section, sec-rank Multiple rank clauses can occur in a single select clause Ranking is done after applying group by clause/aggregation,Ranking (Cont.),Other ranking functions: percent_rank (within partition, if partitioning is done) cume_di

29、st (cumulative distribution)fraction of tuples with preceding values row_number (non-deterministic in presence of duplicates) SQL:1999 permits the user to specify nulls first or nulls lastselect student-id, rank ( ) over (order by marks desc nulls last) as s-rank from student-marks,Ranking (Cont.),F

30、or a given constant n, the ranking the function ntile(n) takes the tuples in each partition in the specified order, and divides them into n buckets with equal numbers of tuples. E.g.:select threetile, sum(salary) from ( select salary, ntile(3) over (order by salary) as threetile from employee) as s

31、group by threetile,Windowing,Used to smooth out random variations. E.g.: moving average: “Given sales values for each date, calculate for each date the average of the sales on that day, the previous day, and the next day” Window specification in SQL: Given relation sales(date, value)select date, sum

32、(value) over (order by date between rows 1 preceding and 1 following) from sales Examples of other window specifications: between rows unbounded preceding and current rows unbounded preceding range between 10 preceding and current row All rows with values between current row value 10 to current valu

33、e range interval 10 day preceding Not including current row,Windowing (Cont.),Can do windowing within partitions E.g. Given a relation transaction (account-number, date-time, value), where value is positive for a deposit and negative for a withdrawal “Find total balance of each account after each tr

34、ansaction on the account”select account-number, date-time, sum (value ) over (partition by account-number order by date-time rows unbounded preceding) as balance from transaction order by account-number, date-time,Data Warehousing,Data sources often store only current data, not historical data Corpo

35、rate decision making requires a unified view of all organizational data, including historical data A data warehouse is a repository (archive) of information gathered from multiple sources, stored under a unified schema, at a single site Greatly simplifies querying, permits study of historical trends

36、 Shifts decision support query load away from transaction processing systems,Data Warehousing,Design Issues,When and how to gather data Source driven architecture: data sources transmit new information to warehouse, either continuously or periodically (e.g. at night) Destination driven architecture:

37、 warehouse periodically requests new information from data sources Keeping warehouse exactly synchronized with data sources (e.g. using two-phase commit) is too expensive Usually OK to have slightly out-of-date data at warehouse Data/updates are periodically downloaded form online transaction proces

38、sing (OLTP) systems. What schema to use Schema integration,More Warehouse Design Issues,Data cleansing E.g. correct mistakes in addresses (misspellings, zip code errors) Merge address lists from different sources and purge duplicates How to propagate updates Warehouse schema may be a (materialized)

39、view of schema from data sources What data to summarize Raw data may be too large to store on-line Aggregate values (totals/subtotals) often suffice Queries on raw data can often be transformed by query optimizer to use aggregate values,Warehouse Schemas,Dimension values are usually encoded using sm

40、all integers and mapped to full values via dimension tables Resultant schema is called a star schema More complicated schema structures Snowflake schema: multiple levels of dimension tables Constellation: multiple fact tables,Data Warehouse Schema,Data Mining,Data mining is the process of semi-autom

41、atically analyzing large databases to find useful patterns Prediction based on past history Predict if a credit card applicant poses a good credit risk, based on some attributes (income, job type, age, ) and past history Predict if a pattern of phone calling card usage is likely to be fraudulent Som

42、e examples of prediction mechanisms: Classification Given a new item whose class is unknown, predict to which class it belongs Regression formulae Given a set of mappings for an unknown function, predict the function result for a new parameter value,Data Mining (Cont.),Descriptive Patterns Associati

43、ons Find books that are often bought by “similar” customers. If a new such customer buys one such book, suggest the others too. Associations may be used as a first step in detecting causation E.g. association between exposure to chemical X and cancer, Clusters E.g. typhoid cases were clustered in an

44、 area surrounding a contaminated well Detection of clusters remains important in detecting epidemics,Classification Rules,Classification rules help assign new objects to classes. E.g., given a new automobile insurance applicant, should he or she be classified as low risk, medium risk or high risk? C

45、lassification rules for above example could use a variety of data, such as educational level, salary, age, etc. person P, P.degree = masters and P.income 75,000 P.credit = excellent person P, P.degree = bachelors and (P.income 25,000 and P.income 75,000) P.credit = good Rules are not necessarily exa

46、ct: there may be some misclassifications Classification rules can be shown compactly as a decision tree.,Decision Tree,Construction of Decision Trees,Training set: a data sample in which the classification is already known. Greedy top down generation of decision trees. Each internal node of the tree

47、 partitions the data into groups based on a partitioning attribute, and a partitioning condition for the node Leaf node: all (or most) of the items at the node belong to the same class, or all attributes have been considered, and no further partitioning is possible.,Best Splits,Pick best attributes

48、and conditions on which to partition The purity of a set S of training instances can be measured quantitatively in several ways. Notation: number of classes = k, number of instances = |S|, fraction of instances in class i = pi. The Gini measure of purity is defined as Gini (S) = 1 - When all instanc

49、es are in a single class, the Gini value is 0 It reaches its maximum (of 1 1 /k) if each class the same number of instances.,Best Splits (Cont.),Another measure of purity is the entropy measure, which is defined as entropy (S) = When a set S is split into multiple sets Si, I=1, 2, , r, we can measure the purity of the resultant set of sets as: purity(S1, S2, , Sr) = The information gain due to particular split of S into Si, i = 1, 2, ., rInformation-gain (S, S1, S2, ., Sr) = purity(S ) purity (S1, S2, Sr),

copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1