
- •Contents
- •Data Mining Tutorials (Analysis Services)
- •Basic Data Mining Tutorial
- •Lesson 1: Preparing the Analysis Services Database (Basic Data Mining Tutorial)
- •Creating an Analysis Services Project (Basic Data Mining Tutorial)
- •Creating a Data Source (Basic Data Mining Tutorial)
- •Creating a Data Source View (Basic Data Mining Tutorial)
- •Lesson 2: Building a Targeted Mailing Structure (Basic Data Mining Tutorial)
- •Creating a Targeted Mailing Mining Model Structure (Basic Data Mining Tutorial)
- •Specifying the Data Type and Content Type (Basic Data Mining Tutorial)
- •Specifying a Testing Data Set for the Structure (Basic Data Mining Tutorial)
- •Lesson 3: Adding and Processing Models
- •Adding New Models to the Targeted Mailing Structure (Basic Data Mining Tutorial)
- •Processing Models in the Targeted Mailing Structure (Basic Data Mining Tutorial)
- •Lesson 4: Exploring the Targeted Mailing Models (Basic Data Mining Tutorial)
- •Exploring the Decision Tree Model (Basic Data Mining Tutorial)
- •Exploring the Clustering Model (Basic Data Mining Tutorial)
- •Exploring the Naive Bayes Model (Basic Data Mining Tutorial)
- •Lesson 5: Testing Models (Basic Data Mining Tutorial)
- •Testing Accuracy with Lift Charts (Basic Data Mining Tutorial)
- •Testing a Filtered Model (Basic Data Mining Tutorial)
- •Lesson 6: Creating and Working with Predictions (Basic Data Mining Tutorial)
- •Creating Predictions (Basic Data Mining Tutorial)
- •Using Drillthrough on Structure Data (Basic Data Mining Tutorial)
- •Lesson 1: Creating the Intermediate Data Mining Solution (Intermediate Data Mining Tutorial)
- •Creating a Solution and Data Source (Intermediate Data Mining Tutorial)
- •Lesson 2: Building a Forecasting Scenario (Intermediate Data Mining Tutorial)
- •Adding a Data Source View for Forecasting (Intermediate Data Mining Tutorial)
- •Creating a Forecasting Structure and Model (Intermediate Data Mining Tutorial)
- •Modifying the Forecasting Structure (Intermediate Data Mining Tutorial)
- •Customizing and Processing the Forecasting Model (Intermediate Data Mining Tutorial)
- •Exploring the Forecasting Model (Intermediate Data Mining Tutorial)
- •Creating Time Series Predictions (Intermediate Data Mining Tutorial)
- •Advanced Time Series Predictions (Intermediate Data Mining Tutorial)
- •Lesson 3: Building a Market Basket Scenario (Intermediate Data Mining Tutorial)
- •Adding a Data Source View with Nested Tables (Intermediate Data Mining Tutorial)
- •Creating a Market Basket Structure and Model (Intermediate Data Mining Tutorial)
- •Modifying and Processing the Market Basket Model (Intermediate Data Mining Tutorial)
- •Exploring the Market Basket Models (Intermediate Data Mining Tutorial)
- •Filtering a Nested Table in a Mining Model (Intermediate Data Mining Tutorial)
- •Predicting Associations (Intermediate Data Mining Tutorial)
- •Lesson 4: Building a Sequence Clustering Scenario (Intermediate Data Mining Tutorial)
- •Creating a Sequence Clustering Mining Model Structure (Intermediate Data Mining Tutorial)
- •Processing the Sequence Clustering Model
- •Exploring the Sequence Clustering Model (Intermediate Data Mining Tutorial)
- •Creating a Related Sequence Clustering Model (Intermediate Data Mining Tutorial)
- •Creating Predictions on a Sequence Clustering Model (Intermediate Data Mining Tutorial)
- •Lesson 5: Building Neural Network and Logistic Regression Models (Intermediate Data Mining Tutorial)
- •Adding a Data Source View for Call Center Data (Intermediate Data Mining Tutorial)
- •Creating a Neural Network Structure and Model (Intermediate Data Mining Tutorial)
- •Exploring the Call Center Model (Intermediate Data Mining Tutorial)
- •Adding a Logistic Regression Model to the Call Center Structure (Intermediate Data Mining Tutorial)
- •Creating Predictions for the Call Center Models (Intermediate Data Mining Tutorial)
- •Creating and Querying Data Mining Models with DMX: Tutorials (Analysis Services - Data Mining)
- •Bike Buyer DMX Tutorial
- •Lesson 1: Creating the Bike Buyer Mining Structure
- •Lesson 2: Adding Mining Models to the Bike Buyer Mining Structure
- •Lesson 3: Processing the Bike Buyer Mining Structure
- •Lesson 4: Browsing the Bike Buyer Mining Models
- •Lesson 5: Executing Prediction Queries
- •Market Basket DMX Tutorial
- •Lesson 1: Creating the Market Basket Mining Structure
- •Lesson 2: Adding Mining Models to the Market Basket Mining Structure
- •Lesson 3: Processing the Market Basket Mining Structure
- •Lesson 4: Executing Market Basket Predictions
- •Time Series Prediction DMX Tutorial
- •Lesson 1: Creating a Time Series Mining Model and Mining Structure
- •Lesson 2: Adding Mining Models to the Time Series Mining Structure
- •Lesson 3: Processing the Time Series Structure and Models
- •Lesson 4: Creating Time Series Predictions Using DMX
- •Lesson 5: Extending the Time Series Model
To execute the query
•In Query Editor, on the toolbar, click Execute.
The status of the query is displayed in the Messages tab at the bottom of Query Editor after the statement finishes executing. Messages should display:
Executing the query Execution complete
A new structure named Forecasting_MIXED_Structure now exists on the server, together with the related mining model Forecasting_MIXED.
In the next lesson, you will add a mining model to the Forecasting_MIXED mining structure that you just created.
Next Lesson
Adding Mining Models to the Time Series Mining Structure
See Also
Mining Model Content for Time Series Models (Analysis Services - Data Mining) Microsoft Time Series Algorithm Technical Reference (Analysis Services - Data Mining)
Lesson 2: Adding Mining Models to the Time Series Mining Structure
In this lesson, you will add a new mining model to the mining structure that you just created in Creating a Time Series Mining Structure.
ALTER MINING STRUCTURE Statement
In order to add a new mining model to an existing mining structure, you use the ALTER MINING STRUCTURE (DMX) statement. The code in the statement can be broken into the following parts:
•Identifying the mining structure
•Naming the mining model
•Defining the key column
•Defining the predictable columns
•Specifying the algorithm and any parameter changes
The following is a generic example of the ALTER MINING STRUCTURE statement:
ALTER MINING STRUCTURE [<mining structure name>] ADD MINING MODEL [<mining model name>]
([<key columns>], <mining model columns>
)
199
USING <algorithm name>([<algorithm parameters>]) [WITH DRILLTHROUGH]
The first line of the code identifies the existing mining structure to which the mining models will be added:
ALTER MINING STRUCTURE [<mining structure name>]
The next line of the code names the mining model that will be added to the mining structure:
ADD MINING MODEL [<mining model name>]
For information about naming an object in DMX, see Identifiers (DMX).
The next lines of the code define columns from the mining structure that will be used by the mining model:
[<key columns>], <mining model columns>
You can only use columns that already exist in the mining structure, and the first column in the list must be the key column from the mining structure.
The next lines of the code defines the mining algorithm that generates the mining model and the algorithm parameters that you can set on the algorithm, and specify whether you can drill down from the mining model into view detailed data in the training cases:
USING <algorithm name>([<algorithm parameters>]) WITH DRILLTHROUGH
For more information about the algorithm parameters that you can adjust, see Microsoft Time Series Algorithm Technical Reference (Analysis Services - Data Mining).
You can specify that a column in the mining model be used for prediction by using the following syntax:
<mining model column> PREDICT
Lesson Tasks
You will perform the following tasks in this lesson:
•Add a new time series mining model to the structure.
•Change the algorithm parameters to use a different method of analysis and prediction
Adding an ARIMA Time Series Model to the Structure
The first step is to add a new forecasting mining model to the existing structure. By default, the Microsoft Time Series algorithm creates time series mining models by using two algorithms, ARIMA and ARTXP, and blending the results. However, you can specify a single algorithm to use, or you can specify the exact blend of algorithms. In this step, you will add a new model that uses only the ARIMA algorithm. This algorithm is optimized for long-term prediction.
200
To add an ARIMA time series mining model
1.In Object Explorer, right-click the instance of Analysis Services, point to New Query, and then click DMX to open Query Editor and a new, blank query.
2.Copy the generic example of the ALTER MINING STRUCTURE statement into the blank query.
3.Replace the following:
<mining structure name> with:
[Forecasting_MIXED_Structure]
4. Replace the following:
<mining model name> with:
Forecasting_ARIMA
5. Replace the following:
<key columns>, with:
[ReportingDate],
[ModelRegion]
Note that you do not need to repeat any of the date type or content type information that you provided in the CREATE MINING MODEL statement, because this information is already stored in the mining structure.
6. Replace the following:
<mining model columns> with:
([Quantity] PREDICT, [Amount] PREDICT
)
7. Replace the following:
USING <algorithm name>([<algorithm parameters>]) [WITH DRILLTHROUGH]
with:
USING Microsoft_Time_Series (AUTO_DETECT_PERIODICITY = .08, FORECAST_METHOD = 'ARIMA')
WITH DRILLTHROUGH
201
The resulting statement should now be as follows:
ALTER MINING STRUCTURE [Forecasting_MIXED_Structure] ADD MINING MODEL [Forecasting_ARIMA]
(
([ReportingDate],
[ModelRegion], ([Quantity] PREDICT, [Amount] PREDICT
)
USING Microsoft_Time_Series (AUTO_DETECT_PERIODICITY = .08, FORECAST_METHOD = 'ARIMA')
WITH DRILLTHROUGH
8.On the File menu, click Save DMXQuery1.dmx As.
9.In the Save As dialog box, browse to the appropriate folder, and name the file
Forecasting_ARIMA.dmx.
10.On the toolbar, click the Execute button.
Adding an ARTXP Time Series Model to the Structure
The ARTXP algorithm was the default time series algorithm in SQL Server 2005 and is optimized for short-term prediction. To compare predictions by using all three time series algorithms, you will add one more model that is based on the ARTXP algorithm.
To add an ARTXP time series mining model
1.Copy the following code into a blank query window.
Note that you do not need to change anything except the name of the new mining model, and the value of the FORECAST_METHOD parameter.
ALTER MINING STRUCTURE [Forecasting_MIXED_Structure] ADD MINING MODEL [Forecasting_ARTXP]
(
([ReportingDate],
[ModelRegion], ([Quantity] PREDICT, [Amount] PREDICT
)
USING Microsoft_Time_Series (AUTO_DETECT_PERIODICITY = .08, FORECAST_METHOD = 'ARTXP')
202