Integrating Data Mining with SQL Databases: OLE DB for Data ...

1,034 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,034
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
26
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Integrating Data Mining with SQL Databases: OLE DB for Data ...

  1. 1. Integrating Data Mining with SQL Databases: OLE DB for Data Mining Presenter: Lei Chen
  2. 2. Overview <ul><li>Background knowledge </li></ul><ul><li>Overview and design philosophy </li></ul><ul><li>Basic components </li></ul><ul><li>Operations on data model </li></ul><ul><li>Concluding remarks </li></ul>
  3. 3. What is Data Ming? <ul><li>Definition:   Discovery of useful summaries of data. </li></ul><ul><li>Some Examples of Applications: </li></ul><ul><li>Decision Trees constructed from bank-loan histories to produce algorithms to decide whether to grant a loan. </li></ul><ul><li>Patterns of traveler behavior mined to manage the sale of discounted seat on the planes, rooms in hotels, etc. </li></ul><ul><li>“ Diapers and Beer” in supermarkets for increasing sales. </li></ul><ul><li>Comparison of genotype with/without a condition allowed the discovery of genes that account for diseases. </li></ul>
  4. 4. Why need OLE DB <ul><li>To address the following needs, Microsoft created OLE DB . </li></ul><ul><li>A vast amount of the critical information is found outside of traditional corporate databases, instead, found in file systems, or personal systems such as Microsoft Access , spreadsheets, E-mails, and even on the World Wide Web. </li></ul><ul><li>To take advantage of the benefits of database technology, such as queries, transactions, and security, businesses have traditionally had to move the data from its original containing system into (DBMS). This process is expensive and redundant. </li></ul><ul><li>Furthermore, businesses need to be able to exploit the advantages of database technology not only when accessing data within a DBMS but also when accessing data from any other type of information container. </li></ul>
  5. 5. What is OLE DB? <ul><li>O bject L inking and E mbedding for D ata B ases , is a means Microsoft use for accessing different types of data stores in a uniform manner. Now, OLE DB is an open technology available royalty free in many operating systems. </li></ul><ul><li>OLE DB is a set of Component Object Model (COM) interfaces that provide applications with uniform access to data stored in diverse information sources and that also provide the ability to implement additional database services. </li></ul><ul><li>OLE DB is the way to access data in a MS COM environment. </li></ul><ul><li>References:http ://msdn.microsoft.com/library/default.asp?url=/library/en-us/oledb/htm/oledboverview_of_ole_db.asp </li></ul>
  6. 6. Overview <ul><li>Background knowledge </li></ul><ul><li>Overview and design philosophy </li></ul><ul><li>Basic components </li></ul><ul><li>Operations on data model </li></ul><ul><li>Concluding remarks </li></ul>
  7. 7. Why OLE DB for Data Mining? <ul><li>Industry standard is critical for data mining development, usage, interoperability, and exchange. </li></ul><ul><li>Objects, data types, properties, and important programming in OLE DB naturally cater to the needs </li></ul><ul><li>Building mining applications over relational databases is nontrivial. </li></ul><ul><ul><li>Need different customized data mining algorithms and methods. </li></ul></ul><ul><ul><li>Significant work on the part of application builders. </li></ul></ul><ul><li>Data providers: All structured data, i.e. data that support OLE DB </li></ul><ul><li>Data consumers : All development tools or languages requiring access to a broad range of data </li></ul>
  8. 8. Motivation of OLE DB for DM <ul><li>Facilitate deployment of data mining models </li></ul><ul><ul><li>Generate data mining models </li></ul></ul><ul><ul><li>Store, maintain and refresh models as data are updated </li></ul></ul><ul><ul><li>Programmatically use the model on other data sets </li></ul></ul><ul><ul><li>Browse models </li></ul></ul><ul><li>Enable enterprise application developers to participate in building data mining solutions </li></ul>
  9. 9. Features of OLE DB for DM <ul><li>Independent of provider or software </li></ul><ul><li>Not specialized to any specific mining model </li></ul><ul><li>Structured to cater to all well-known mining models </li></ul><ul><li>Part of upcoming release of Microsoft SQL Server 2000 </li></ul><ul><li>Not propose new Data mining algorithm, but to suggest an infrastructure to “plug in” any algorithms. </li></ul>
  10. 10. OLE DB for DM: Overview <ul><li>Core relational engine exposes OLE DB in a language-based API </li></ul><ul><li>Analysis server exposes OLE DB OLAP and OLE DB DM </li></ul><ul><li>Maintain SQL metaphor </li></ul><ul><li>Reuse existing notions </li></ul>RDB engine OLE DB Analysis Server OLE DB DM Data mining applications
  11. 11. Key Operations to Support Data Mining Models <ul><li>Define a mining model </li></ul><ul><ul><li>Attributes to be predicted </li></ul></ul><ul><ul><li>Attributes to be used for prediction </li></ul></ul><ul><ul><li>Algorithm used to build the model </li></ul></ul><ul><li>Populate a mining model from training data </li></ul><ul><li>Predict attributes for new data </li></ul><ul><li>Browse a mining model fro reporting and visualization </li></ul>
  12. 12. Data Mining Model is Analogous to A Table in SQL <ul><li>Create a data mining module object </li></ul><ul><ul><li>CREATE MINING MODEL [model_name] </li></ul></ul><ul><li>Insert training data into the model and train it </li></ul><ul><ul><li>INSERT INTO [model_name] </li></ul></ul><ul><li>Use the data mining model </li></ul><ul><ul><li>SELECT relation_name.[id], [model_name].[predict_attr] </li></ul></ul><ul><ul><li>consult DMM content in order to make predictions and browse statistics obtained by the model </li></ul></ul><ul><li>Use DELETE to empty/reset </li></ul><ul><li>Predictions on datasets: prediction join between a model and a data set (tables) </li></ul><ul><li>Deploy DMM by just writing SQL queries! </li></ul>
  13. 13. Overview <ul><li>Background knowledge </li></ul><ul><li>Overview and design philosophy </li></ul><ul><li>Basic components </li></ul><ul><li>Operations on data model </li></ul><ul><li>Concluding remarks </li></ul>
  14. 14. Two Basic Components Beyond Traditional OLE DB <ul><li>Cases/caseset: input data </li></ul><ul><ul><li>A table or nested tables (for hierarchical data) </li></ul></ul><ul><li>Data mining model (DMM): a special type of table </li></ul><ul><ul><li>A caseset is associated with a DMM and meta-info while creating a DMM </li></ul></ul><ul><ul><li>Save mining algorithm and resulting abstraction instead of data itself </li></ul></ul><ul><ul><li>Fundamental operations: CREATE, INSERT INTO, PREDICTION JOIN, SELECT, DELETE FROM, and DROP </li></ul></ul>
  15. 15. Flatterned Representation of Caseset Problem: Lots of replication! Age Prob Age Hair Color Gender Customer ID Customers Car Prob Car Customer ID Car Owernership Product Type Quantity Product Name Customer ID Product Purchases 50% Van Food 6 Ham 100% 35 Black Male 1 50% Van Elec 1 VCR 100% 35 Black Male 1 50% Van Elec 1 TV 100% 35 Black Male 1 100% Car Food 6 Ham 100% 35 Black Male 1 100% Car Elec 1 VCR 100% 35 Black Male 1 100% Car Elec 1 TV 100% 35 Black Male 1 Car prob Car Type Quan Prod Age prob Age Hair Gend CID
  16. 16. Logical Nested Table Representation of Caseset <ul><li>Caseset: a set of cases. </li></ul><ul><li>Use Data Shaping Service to generate a hierarchical rowset. </li></ul>Car Ownership Product Purchases Food 6 Ham 50% Van Elec 1 VCR 100% Car Elec 1 TV 100% 35 Black Male 1 Car prob Car Type Quan Prod Age prob Age Hair Gend CID
  17. 17. Defining A Data Mining Model <ul><li>The name of the model </li></ul><ul><li>The algorithm and parameters </li></ul><ul><li>The algorithm for prediction using this model </li></ul><ul><li>The columns of caseset and the relationships among columns </li></ul><ul><li>“ Source columns” and “prediction columns” </li></ul>
  18. 18. Example CREATE MINING MODEL [Age Prediction] %Name of Model ( [Customer ID] LONG KEY, %source column [Gender] TEXT DISCRETE, %source column [Age] Double DISCRETIZED() PREDICT, %prediction column [Product Purchases] TABLE %source column ( [Product Name] TEXT KEY, %source column [Quantity] DOUBLE NORMAL CONTINUOUS, %source column [Product Type] TEXT DISCRETE RELATED TO [Product Name] %source column )) USING [Decision_Trees_101] %Mining algorithm used
  19. 19. Content Type of Columns: Column Specifiers <ul><li>KEY </li></ul><ul><li>ATTRIBUTE </li></ul><ul><li>RELATION (RELATED TO clause) </li></ul><ul><li>QUALIFIER (OF clause) </li></ul><ul><ul><li>PROBABILITY: [0, 1] </li></ul></ul><ul><ul><li>VARIANCE </li></ul></ul><ul><ul><li>SUPPORT </li></ul></ul><ul><ul><li>PROBABILITY-VARIANCE </li></ul></ul><ul><ul><li>ORDER </li></ul></ul><ul><ul><li>TABLE </li></ul></ul>
  20. 20. Content Type of Columns: Attribute Types <ul><li>DISCRETE: “Area Code” </li></ul><ul><li>ORDERED: “ a ranking of skill level” (say one to five) </li></ul><ul><li>CYCLICAL: “day of week” </li></ul><ul><li>CONTINOUS: “salary” </li></ul><ul><li>DISCRETIZED: “Age” </li></ul><ul><li>SEQUENCE_TIME a measurement for “time” </li></ul>
  21. 21. Overview <ul><li>Background knowledge </li></ul><ul><li>Overview and design philosophy </li></ul><ul><li>Basic components </li></ul><ul><li>Operations on data model </li></ul><ul><li>Concluding remarks </li></ul>
  22. 22. Populating a DMM <ul><li>Once a mining model is defined, the next step is to populate a mining model by consuming a caseset that satisfies specification; In other works, pull the information into a single rowset, and use INSERT INTO statement </li></ul><ul><li>Consume a case using the data mining model </li></ul><ul><li>Use SHAPE statement to create the nested table from the input data. </li></ul><ul><li>Train the model using the data and algorithm specified in create syntax. </li></ul>
  23. 23. Example: Populating a DMM INSERT INTO [Age Prediction] ( [Customer ID], [Gender], [Age], [Product Purchases]( [Product Name], [Quantity], [Product Type]) ) SHAPE {SELECT [Customer ID], [Gender], [Age] FROM Customers ORDER BY [Customer ID]} APPEND {SELECT [CustID], {product Name], [Quantity], [Product Type] FROM Sales ORDER BY [CustID]} RELATE [Customer ID] TO [CustID] ) AS [Product Purchases]
  24. 24. Using Data Model to Predict <ul><li>Prediction join </li></ul><ul><ul><li>Prediction on dataset D using DMM M </li></ul></ul><ul><ul><li>Different to join statement in SQL </li></ul></ul><ul><li>DMM: a “truth table” </li></ul><ul><li>SELECT statement associated with PREDICTION JOIN specifies values extracted from DMM </li></ul>
  25. 25. Example: Using a DMM in Prediction SELECT t.[Customer ID], [Age Prediction].[Age] FROM [Age Prediction] PREDICTION JOIN (SHAPE {SELECT [Customer ID], [Gender] FROM Customers ORDER BY [Customer ID]} APPEND ( {SELECT [CustID], [Product Name], [Quantity] FROM Sales ORDER BY [CustID]} RELATE [Customer ID] TO [CustID] ) AS [Product Purchases]) AS t ON [Age Prediction].[Gender]=t.[Gender] AND [Age Prediction].[Product Purchases].[Product Name]=t.[Product Purchases].[Product Name] AND [Age Prediction].[Product Purchases].[Quantity]=t.[Product Purchases].[Quantity]
  26. 26. Browsing DMM <ul><li>What is in a DMM? </li></ul><ul><ul><li>Rules, formulas, trees, …, etc </li></ul></ul><ul><li>Browsing DMM </li></ul><ul><ul><li>Visualization </li></ul></ul>
  27. 27. Concluding Remarks <ul><li>This paper focus on the problem of integration of data mining with relational databases, rather than KDD algorithms. </li></ul><ul><li>OLE DB for DM integrates data mining and database systems </li></ul><ul><ul><li>A good standard for mining application builders </li></ul></ul><ul><li>Possible improvement </li></ul><ul><ul><li>Extend the functionalities of the OLE DB DM? </li></ul></ul><ul><ul><li>Design more concrete language primitives? </li></ul></ul>
  28. 28. Finally See why OLEDB for Data Mining? <ul><li>Disadvantages of other Data Mining Languages: They can not deal with either arbitrary mining models or integration of relational database API with mining applications. So Microsoft proposes OLEDB for DM. </li></ul><ul><li>DMQL: A Data Mining Query Language for Relational Databases </li></ul><ul><li>MSQL (Imielinski & Virmani’99) </li></ul><ul><li>MineRule (Meo Psaila and Ceri’96) </li></ul><ul><li>Query flocks based on Datalog syntax (Tsur et al’98) </li></ul><ul><li>CRISP-DM (CRoss-Industry Standard Process for Data Mining) </li></ul>
  29. 29. Questions and comments? <ul><li>Thank You! </li></ul>
  30. 30. OLE DB (sometimes written as OLEDB or OLE-DB), <ul><li>OLE DB (sometimes written as OLEDB or OLE-DB), Object Linking and Embedding for Databases, is a means Microsoft use for accessing different types of data stores in a uniform manner. Microsoft has separated the data store from the application that needs access to it through the use of this technology: this was done because different applications need access to different types and sources of data and do not necessarily want to know how to access functionality with technology-specific methods. OLE DB is conceptually divided into consumers and providers . The consumers are the applications that need access to the data, and the provider is the software component that exposes an OLE DB interface through the use of the Component Object Model (or COM). </li></ul><ul><li>OLE DB is part of the MDAC (Microsoft Data Access Components) stack and is the database access interface technology. MDAC is a group of Microsoft technologies that interact together as a framework that allows programmers a uniform and comprehensive way of developing applications for accessing almost any data store. OLE DB providers can be created to access such simple data stores as a text file or spreadsheet , through to such complex databases as Oracle and SQL Server . However, because different data store technology can have different capabilities, OLE DB providers may not implement every possible interface available to OLE DB. The capabilities that are available are implemented through the use of COM objects - an OLE DB provider will map the data store technologies functionality to a particular COM interface. Microsoft calls the availability of an interface to be &quot;provider-specific&quot; as it may not be applicable depending on the database technology involved. Additionally, however, providers may also augment the capabilities of a data store - these capabilities are known as services in Microsoft parlance. </li></ul>
  31. 31. ADO <ul><li>Microsoft ADO (ActiveX Data Objects) is a Component object model object for accessing data sources. It provides a layer between programming languages and OLE DB (a means of accessing data stores, whether they be databases or otherwise, in a uniform manner), which allows a developer to write programs which access data, without knowing how the database is implemented. You must be aware of your database for connection only. No knowledge of SQL is required to access a database when using ADO, although one can use ADO to execute arbitrary SQL commands. The disadvantage of this is that this introduces a dependency upon the database. </li></ul>
  32. 32. Component Object Model <ul><li>Component Object Model , or COM , is a Microsoft platform for software componentry . It is used to enable cross-application communication and dynamic object creation in any programming language that supports the technology. COM is often used in the software development world as an umbrella term that encompasses the OLE , ActiveX, COM+ and DCOM technologies. COM has been around since 1993, however Microsoft only really started emphasizing the name around 1997. </li></ul><ul><li>Although it has been implemented on several platforms, it is primarily used with Microsoft Windows . COM is expected to be replaced to at least some extent by the Microsoft .NET framework. </li></ul>
  33. 33. Component Object Model , <ul><li>Component Object Model , or COM , is a Microsoft platform for software componentry . It is used to enable cross-application communication and dynamic object creation in any programming language that supports the technology. COM is often used in the software development world as an umbrella term that encompasses the OLE , ActiveX, COM+ and DCOM technologies. </li></ul>
  34. 34. Component Object Model , <ul><li>The object model for all Windows software </li></ul><ul><li>Proven, de facto industry-standard </li></ul><ul><li>Becoming available on non-Windows platforms </li></ul><ul><ul><li>Unix via Bristol and Mainsoft products </li></ul></ul><ul><ul><li>Software AG has 18 ports in progress for Unix and Mainframe platforms </li></ul></ul>
  35. 35. data warehouse <ul><li>A data warehouse is, primarily, a record of an enterprise's past transactional and operational information, stored in a database designed to favour efficient data analysis and reporting (especially OLAP ). Data warehousing is not meant for current &quot;live&quot; data. </li></ul><ul><li>Data warehouses often hold large amounts of information which are sometimes subdivided into smaller logical units called dependent data marts . </li></ul><ul><li>Usually, two basic ideas guide the creation of a data warehouse: </li></ul><ul><li>Integration of data from distributed and differently structured databases, which facilitates a global overview and comprehensive analysis in the data warehouse. </li></ul><ul><li>Separation of data used in daily operations from data used in the data warehouse for purposes of reporting, decision support, analysis and controlling. </li></ul><ul><li>Periodically, one imports data from enterprise resource planning (ERP) systems and other related business software systems into the data warehouse for further processing. It is common practice to &quot;stage&quot; data prior to merging it into a data warehouse. In this sense, to &quot;stage data&quot; means to queue it for preprocessing, usually with an ETL tool. The preprocessing program reads the staged data (often a business 's primary OLTP databases), performs qualitative preprocessing or filtering (including denormalization , if deemed necessary), and writes it into the warehouse. </li></ul>
  36. 36. ODBC <ul><li>(pronounced as separate letters) Short for O pen D ata B ase C onnectivity , a standard database access method developed by the SQL Access group in 1992. The goal of ODBC is to make it possible to access any data from any application , regardless of which database management system (DBMS) is handling the data. ODBC manages this by inserting a middle layer, called a database driver , between an application and the DBMS. The purpose of this layer is to translate the application's data queries into commands that the DBMS understands. For this to work, both the application and the DBMS must be ODBC-compliant -- that is, the application must be capable of issuing ODBC commands and the DBMS must be capable of responding to them. Since version 2.0, the standard supports SAG SQL . </li></ul>
  37. 37. OLE DB <ul><li>Object Linking and Embedding for DataBases , is a means Microsoft use for accessing different types of data stores in a uniform manner. Microsoft has separated the data store from the application that needs access to it through the use of this technology: this was done because different applications need access to different types and sources of data and do not necessarily want to know how to access functionality with technology-specific methods. OLE DB is conceptually divided into consumers and providers . The consumers are the applications that need access to the data, and the provider is the software component that exposes an OLE DB interface through the use of the Component Object Model (or COM). </li></ul>

×