SQL Server Analysis Services

Mining Model Content

This document provides an overview of the different types of content that can be extracted from SQL Server Analysis Services (SSAS) mining models. Understanding this content is crucial for interpreting the insights derived from your data and for leveraging these insights in your applications.

Introduction

SQL Server Analysis Services employs various data mining algorithms to discover patterns and relationships within your data. The output of these algorithms, known as mining model content, represents the learned knowledge. This content can be visualized, queried, and used for predictions.

Types of Mining Model Content

The specific content generated by an Analysis Services mining model depends on the algorithm used. Here are some common types of mining model content:

Association Rules

Generated by the Association Rules algorithm, this content describes frequently occurring sets of items and the rules that connect them. It's useful for market basket analysis and understanding co-occurrence patterns.

-- Example of querying Association Rules content
SELECT
    *
FROM
    [MyModel].RULES

Clusters

Produced by the Clustering algorithm, this content describes distinct groups (clusters) of similar data points. It helps in segmenting your data and understanding customer behavior.

-- Example of querying Cluster Content
SELECT
    *
FROM
    [MyModel].CLUSTERS

Decision Trees

The Decision Tree algorithm generates a tree-like structure where nodes represent tests on attributes and branches represent outcomes. This content is excellent for understanding the factors that influence a target outcome.

-- Example of querying Decision Tree Content
SELECT
    *
FROM
    [MyModel].TREES

Sequence Clusters

The Sequence Clustering algorithm identifies groups of sequences that share common patterns. This is useful for analyzing customer purchase paths or website navigation flows.

-- Example of querying Sequence Cluster Content
SELECT
    *
FROM
    [MyModel].SEQUENCE_CLUSTERS

Time Series

Generated by the Time Series algorithm, this content models the behavior of data over time, allowing for forecasting and trend analysis. Useful for sales forecasting, stock market prediction, etc.

-- Example of querying Time Series Content
SELECT
    *
FROM
    [MyModel].TIME_SERIES

Linear Regression

The Linear Regression algorithm models the relationship between a dependent variable and one or more independent variables using a linear equation.

-- Example of querying Linear Regression Content
SELECT
    *
FROM
    [MyModel].REGRESSIONS

Logistic Regression

Similar to linear regression but used for predicting binary outcomes. It models the probability of an event occurring.

-- Example of querying Logistic Regression Content
SELECT
    *
FROM
    [MyModel].REGRESSIONS

Neural Networks

The Neural Network algorithm models complex, non-linear relationships by simulating interconnected neurons. This content can be abstract but powerful for intricate patterns.

-- Example of querying Neural Network Content
SELECT
    *
FROM
    [MyModel].NEURAL_NETWORKS

Clustering Feature Usage

This content, often associated with clustering and other algorithms, details which features were most influential in forming the discovered patterns or clusters.

-- Example of querying Feature Usage
SELECT
    *
FROM
    [MyModel].FEATURE_PROPERTIES

Accessing Mining Model Content

Mining model content can be accessed in several ways:

  • SQL Server Management Studio (SSMS): You can visualize and explore the content directly within SSMS by right-clicking on a mining model and selecting "View Mining Model Viewer".
  • Data Mining Extensions (DMX): Use DMX queries to retrieve specific parts of the model content programmatically. The examples above demonstrate basic DMX queries.
  • Analysis Management Objects (AMO): AMO provides a .NET object model for managing SSAS databases, including mining models and their content.

Using Mining Model Content

Once you have accessed the mining model content, you can use it for:

  • Interpretation: Understand the discovered patterns and insights.
  • Prediction: Use the model to predict outcomes for new data.
  • Reporting: Integrate insights into reports and dashboards.
  • Further Analysis: Use the content as input for other analytical processes.

The specific methods for using the content will vary based on the algorithm and your business requirements. For detailed DMX syntax and AMO usage, refer to the comprehensive SSAS documentation.