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 Type | Description | Typical Use Cases |
|---|---|---|
| Microsoft Association | Finds items that frequently occur together. | Market basket analysis, cross‑selling. |
| Microsoft Clustering | Partitions data into groups of similar rows. | Customer segmentation, anomaly detection. |
| Microsoft Decision Trees | Creates a tree‑based predictive model. | Churn prediction, credit scoring. |
| Microsoft Naïve Bayes | Probabilistic classification based on Bayes theorem. | Email spam detection, medical diagnosis. |
| Microsoft Neural Network | Non‑linear predictive modeling. | Image recognition, complex forecasting. |
| Microsoft Logistic Regression | Binary classification with logistic function. | Fraud detection, default risk. |
| Microsoft Time Series | Predicts future values based on temporal data. | Sales forecasting, demand planning. |
| Microsoft Sequence Clustering | Groups similar sequences of events. | Web click‑stream analysis, process mining. |
| Microsoft Sequence Mining | Finds frequent sequences in event data. | Customer journey mapping. |
| Microsoft Supervised Neural Network | Enhanced neural network for supervised learning. | Advanced classification problems. |
Creating a Data Mining Model
- Open SQL Server Data Tools (SSDT) and create a new Analysis Services project.
- Add a Data Source pointing to the relational database that contains the training data.
- Define a Data Source View (DSV) and select the tables/columns required for the model.
- Right‑click the Mining Structures folder → New Mining Structure.
- Choose a Model Type and configure the Mining Columns (input, target, and optional columns).
- Complete the wizard to generate the structure and associated model.
- 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');