Microsoft Docs

Data Mining Models

Data mining models in SQL Server Analysis Services (SSAS) enable you to discover patterns and predict future trends from your data. This topic explains the types of models supported, how to create them, and how to use them in your solutions.

Supported Data Mining Model Types

Model TypeDescriptionTypical Use Cases
Microsoft AssociationFinds items that frequently occur together.Market basket analysis, cross‑selling.
Microsoft ClusteringPartitions data into groups of similar rows.Customer segmentation, anomaly detection.
Microsoft Decision TreesCreates a tree‑based predictive model.Churn prediction, credit scoring.
Microsoft Naïve BayesProbabilistic classification based on Bayes theorem.Email spam detection, medical diagnosis.
Microsoft Neural NetworkNon‑linear predictive modeling.Image recognition, complex forecasting.
Microsoft Logistic RegressionBinary classification with logistic function.Fraud detection, default risk.
Microsoft Time SeriesPredicts future values based on temporal data.Sales forecasting, demand planning.
Microsoft Sequence ClusteringGroups similar sequences of events.Web click‑stream analysis, process mining.
Microsoft Sequence MiningFinds frequent sequences in event data.Customer journey mapping.
Microsoft Supervised Neural NetworkEnhanced neural network for supervised learning.Advanced classification problems.

Creating a Data Mining Model

  1. Open SQL Server Data Tools (SSDT) and create a new Analysis Services project.
  2. Add a Data Source pointing to the relational database that contains the training data.
  3. Define a Data Source View (DSV) and select the tables/columns required for the model.
  4. Right‑click the Mining Structures folder → New Mining Structure.
  5. Choose a Model Type and configure the Mining Columns (input, target, and optional columns).
  6. Complete the wizard to generate the structure and associated model.
  7. Process the structure to train the model against the data.

Viewing Model Results

After processing, you can explore results via the Mining Model Viewer in SSDT, or query the model using MDX, DMX, or T‑SQL.

Example DMX Query

SELECT
    [*]
FROM
    [MiningModel]
NATURAL PREDICTION JOIN
    (SELECT 1 AS Age, 'M' AS Gender) AS t;

Sample MDX for Prediction

SELECT
    [Prediction].[Probability] ON COLUMNS,
    [Prediction].[ID] ON ROWS
FROM
    OPENQUERY([YourServer],
        'SELECT * FROM [YourDatabase].[dbo].[YourMiningModel]
         NATURAL PREDICTION JOIN (SELECT 35 AS Age, ''F'' AS Gender) AS t');