
Mining Structure and Mining Models
Before you begin to create DMX statements, it is important to understand the main objects that Analysis Services uses to create mining models. The mining structure is a data structure that defines the data domain from which mining models are built. A single mining structure can contain multiple mining models that share the same domain. A mining model applies a mining model algorithm to the data, which is represented by a mining structure.
The building blocks of the mining structure are the mining structure columns, which describe the data that the data source contains. These columns contain information such as data type, content type, and how the data is distributed.
Mining models must contain the key column described in the mining structure, as well as a subset of the remaining columns. The mining model defines the usage for each column and defines the algorithm that is used to create the mining model. For example, in DMX you can specify that a column is a Key column or a PREDICT column. If a column is left unspecified, it is assumed to be an input column.
In DMX, there are two ways to create mining models. You can either create the mining structure and associated mining model together by using the CREATE MINING MODEL statement, or you can first create a mining structure by using the CREATE MINING STRUCTURE statement, and then add a mining model to the structure by using the ALTER STRUCTURE statement. These methods are described below.
- CREATE MINING MODEL
-
Use this statement to create a mining structure and associated mining model together using the same name. The mining model name is appended with "Structure" to differentiate it from the mining structure. This statement is useful if you are creating a mining structure that will contain a single mining model.
For more information, see CREATE MINING MODEL (DMX).
- ALTER MINING STRUCTURE
-
Use this statement to add a mining model to a mining structure that already exists on the server. This statement is useful if you want to create a mining structure that contains several different mining models. There are several reasons that you would want to add more than one mining model in a single mining structure. For example, you may create several mining models using different algorithms to see which one works best. You may create several mining models using the same algorithm, but with a parameter set differently for each mining model to find the best setting for the parameter.
For more information, see ALTER MINING STRUCTURE (DMX).
Because you will create a mining structure that contains several mining models, you will use the second method in this tutorial.
For More Information
Data Mining Extensions (DMX) Reference, Understanding the Select Statement (DMX), Prediction Queries (DMX)