MSDN Documentation

SQL Server Analysis Services - Mining Models

Understanding Mining Model Content

This document provides a detailed explanation of how to interpret the content of mining models created in SQL Server Analysis Services (SSAS). Understanding the structure and meaning of model content is crucial for extracting meaningful insights and making accurate predictions.

Overview of Model Content

Each mining model in SSAS contains information specific to the algorithm used to create it. This content is stored in a hierarchical structure that can be queried using the DISCOVER_AMINING_MODEL_CONTENT rowset, or visualized through SQL Server Management Studio (SSMS) or SQL Server Data Tools (SSDT).

Common Elements of Mining Model Content

While specific content varies by algorithm, several common elements are found across most mining models:

Algorithm-Specific Content

The richness of model content is best illustrated by examining specific algorithms:

1. Decision Tree Models

Decision tree models represent a series of rules that partition the data. The content includes:

Example of a split node property:

{ "PropertyName": "CharacteristicName", "Value": "Age" }
{ "PropertyName": "Operator", "Value": "<=" }
{ "PropertyName": "Value", "Value": "35" }

2. Clustering Models

Clustering models group similar data points into clusters. The content describes:

Example of cluster characteristics:

{ "PropertyName": "AttributeName", "Value": "Income" }
{ "PropertyName": "AttributeName", "Value": "Region" }
{ "PropertyName": "Support", "Value": 0.25 }

3. Association Rule Models

Association rule models discover relationships between items in transactional data. The content typically includes:

Tip:

The MODEL_SCHEMA property of a mining model returns an XML schema describing the structure and content of the model, which can be invaluable for programmatic access.

Querying Mining Model Content

You can retrieve mining model content using DAX or AMO. The primary method is through Analysis Services' XML for Analysis (XMLA) Discover commands targeting specific rowsets, such as:

A typical DMX query to retrieve content might look like this:

SELECT
    NODE_UNIQUE_NAME,
    NODE_CAPTION,
    NODE_TYPE,
    RELATIONSHIP_TYPE,
    CONTENT,
    CHILD_NODE_ID,
    PARENT_NODE_ID
FROM
    [YourModelName].CONTENT
WHERE
    NODE_TYPE = 20 -- Example: Leaf node type

Note:

The interpretation of content can be complex and algorithm-dependent. Always refer to the specific algorithm documentation for a thorough understanding of the generated content.

Visualizing Model Content

SSMS and SSDT provide visual tools to explore mining model content. These tools translate the raw data into intuitive diagrams, trees, and tables, making it easier to understand the patterns and relationships discovered by the model.

Conclusion

Mastering the interpretation of mining model content is a key step in leveraging the power of data mining with SQL Server Analysis Services. By understanding the structure and specific details provided for each algorithm, you can gain deeper insights into your data and build more effective predictive solutions.