Data Mining Extensions (DMX) Reference SQL Server 2012 Books Online
Total Page:16
File Type:pdf, Size:1020Kb
Data Mining Extensions (DMX) Reference SQL Server 2012 Books Online Summary: Data Mining Extensions (DMX) is a language that you can use to create and work with data mining models in Microsoft SQL Server Analysis Services. You can use DMX to create the structure of new data mining models, to train these models, and to browse, manage, and predict against them. DMX is composed of data definition language (DDL) statements, data manipulation language (DML) statements, and functions and operators. Category: Reference Applies to: SQL Server 2012 Source: SQL Server Books Online (link to source content) E-book publication date: June 2012 Copyright © 2012 by Microsoft Corporation All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. Microsoft and the trademarks listed at http://www.microsoft.com/about/legal/en/us/IntellectualProperty/Trademarks/EN-US.aspx are trademarks of the Microsoft group of companies. All other marks are property of their respective owners. The example companies, organizations, products, domain names, email addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, email address, logo, person, place, or event is intended or should be inferred. This book expresses the author’s views and opinions. The information contained in this book is provided without any express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distributors will be held liable for any damages caused or alleged to be caused either directly or indirectly by this book. Contents Data Mining Extensions (DMX) Reference ............................................................................................................. 6 Structure and Usage of DMX Prediction Queries ............................................................................................... 8 Understanding the Select Statement.................................................................................................................... 10 General Prediction Functions ................................................................................................................................... 13 Data Mining Extensions (DMX) Syntax Elements ............................................................................................. 17 Identifiers ..................................................................................................................................................................... 18 Data Types .................................................................................................................................................................. 20 Expressions ................................................................................................................................................................. 21 Operators .................................................................................................................................................................... 22 Arithmetic Operators .......................................................................................................................................... 23 Comparison Operators ....................................................................................................................................... 24 Logical Operators ................................................................................................................................................. 26 Unary Operators ................................................................................................................................................... 27 Functions ..................................................................................................................................................................... 27 Comments ................................................................................................................................................................... 29 Reserved Keywords.................................................................................................................................................. 30 Content Types............................................................................................................................................................ 31 Distributions ............................................................................................................................................................... 31 Usage ............................................................................................................................................................................ 32 Modeling Flags .......................................................................................................................................................... 33 Data Mining Extensions (DMX) Statement Reference .................................................................................... 35 Data Mining Extensions (DMX) Data Definition Statements.................................................................... 36 CREATE MINING STRUCTURE .......................................................................................................................... 37 ALTER MINING STRUCTURE ............................................................................................................................. 42 CREATE MINING MODEL ................................................................................................................................... 47 DROP MINING STRUCTURE.............................................................................................................................. 51 DROP MINING MODEL ...................................................................................................................................... 52 EXPORT..................................................................................................................................................................... 52 IMPORT .................................................................................................................................................................... 53 SELECT INTO........................................................................................................................................................... 54 Data Mining Extensions (DMX) Data Manipulation Statements ............................................................ 56 DELETE ...................................................................................................................................................................... 56 INSERT INTO .......................................................................................................................................................... 58 SELECT ...................................................................................................................................................................... 61 SELECT DISTINCT FROM <model > .............................................................................................................. 63 SELECT FROM <model>.CONTENT ............................................................................................................... 67 SELECT FROM <model>.CASES ...................................................................................................................... 71 SELECT FROM <model>.SAMPLE_CASES .................................................................................................... 73 SELECT FROM <model>.DIMENSION_CONTENT .................................................................................... 74 SELECT FROM <model> PREDICTION JOIN .............................................................................................. 76 SELECT FROM <model> .................................................................................................................................... 80 SELECT FROM <structure>.CASES ................................................................................................................. 81 <source data query> .......................................................................................................................................... 83 OPENQUERY ........................................................................................................................................................... 84 OPENROWSET ....................................................................................................................................................... 85 SHAPE ....................................................................................................................................................................... 86 UPDATE .................................................................................................................................................................... 88 Data Mining Extensions (DMX) Function Reference ....................................................................................... 88 BottomCount ............................................................................................................................................................. 92 BottomPercent .........................................................................................................................................................