ALTER MINING STRUCTURE (DMX)

Creates a new mining model that is based on an existing mining structure. When you use the ALTER MINING STRUCTURE statement to create a new mining model, the structure must already exist. In contrast, when you use the statement, CREATE MINING MODEL (DMX), you create a model and automatically generate its underlying mining structure at the same time.

If the mining structure contains composite keys, the mining model must include all the key columns that are defined in the structure.

If the model does not require a predictable column, for example, models that are built by using the Microsoft Clustering and Microsoft Sequence Clustering algorithms, you do not have to include a column definition in the statement. All the attributes in the resulting model will be treated as inputs.

In the WITH clause that applies to the case table, you can specify options for both filtering and drillthrough:

Add the FILTER keyword and a filter condition. The filter applies to the cases in the mining model.

Add the DRILLTHROUGH keyword to enable users of the mining model to drill down from model results to the case data. In Data Mining Extensions (DMX), drillthrough can be enabled only when you create the model.

To use both case filtering and drillthrough, you combine the keywords in a single WITH clause by using the syntax shown in the following example:

Column Name and Alias

The column name that you use in the column definition list must be the name of the column as it is used in the mining structure. However, you can optionally define an alias to represent the structure column in the mining model. You can also create multiple column definitions for the same structure column, and assign a different alias and prediction usage to each copy of the column. By default, the structure column name is used if you do not define an alias. For more information, see Create an Alias for a Model Column.

For nested table columns, you specify the name of the nested table, specify the data type as TABLE, and then provide the list of nested columns to include in the model, enclosed in parentheses.

You can define a filter expression that is applied to the nested table by affixing a filter criteria expression after the nested table column definition.

Modeling Flags

Analysis Services supports the following modeling flags for use in mining model columns:

You can define a filter that restricts the cases that are used in the mining model. The filter can be applied to either the columns in the case table or the rows in the nested table, or to both.

Filter criteria expressions are simplified DMX predicates, similar to a WHERE clause. Filter expressions are restricted to formulas that use basic mathematical operators, scalars, and column names. The exception is the EXISTS operator; it evaluates to true if at least one row is returned for the subquery. Predicates can be combined by using the common logical operators: AND, OR, and NOT.

You can adjust the performance and functionality of a model by adding algorithm parameters to the parameter list. The parameters that you can use depend on the algorithm that you specify in the USING clause. For a list of parameters that are associated with each algorithm, see Data Mining Algorithms (Analysis Services - Data Mining).

The following example adds a mining model, Naive Bayes Women, to the New Mailing mining structure. The new model has the same basic structure as the mining model that was added in example 1; however, this model restricts the cases from the mining structure to female customers over the age of 50.

The following example adds a mining model to a modified version of the market basket mining structure. The mining structure used in the example has been modified to add a Region column, which contains attributes for customer region, and an Income Group column, which categorizes customer income by using the values High, Moderate, or Low.

The mining structure also includes a nested table that lists the items that the customer has purchased.

Because the mining structure contains a nested table, you can define a filter on the case table, the nested table, or both. This example combines a case filter and nested row filter to restrict the cases to wealthy European customers who purchased one of the road tire models.