Implementing Data Mining Solutions

Introduction

Data mining in SQL Server Analysis Services (SSAS) enables you to discover patterns, predict outcomes, and integrate predictive insights directly into your business intelligence solutions. This guide walks you through the end‑to‑end process of building, training, validating, and deploying a data mining model.

Prerequisites

Implementation Steps

1. Create a Data Mining Project

In SSDT, select File → New → Project, choose Analysis Services, and then Data Mining Project. Give the project a meaningful name.

2. Define the Mining Structure

  1. Right‑click the project, choose New Mining Structure.
  2. Select a data source view (DSV) that contains your training data.
  3. Choose a mining algorithm (e.g., Microsoft_Clustering).
  4. Map the Case ID, Input Columns, and Prediction Column.

3. Train the Model

Deploy the mining structure to the SSAS instance. The deployment process automatically creates the model and runs the training algorithm.

4. Validate the Model

Use the Prediction Accuracy tab in the mining model designer to evaluate performance metrics such as:

5. Deploy the Model to Production

After validation, redeploy the mining model to the production server. You can now query the model using MDX or DMX.

Sample DMX Queries

SELECT
    *
FROM
    [ClusteringStructure].[ClusteringModel]
WHERE
    NATIVE PREDICTION (
        [Gender], [Age], [Income],
        [Occupation] AS PredictedOccupation
    )
    USING [MyClusteringModel];
SELECT
    [Customer].[Customer].[Customer].Members ON ROWS,
    Predict([ClusteringModel].[Cluster]) ON COLUMNS
FROM
    [ClusteringModel];

Best Practices

References