SQL Server Analysis Services

Multidimensional Modeling

Understanding and Utilizing Mining Structure Usage in SQL Server Analysis Services

Mining structures are fundamental to data mining in SQL Server Analysis Services (SSAS). They define the scope and structure of the data that will be used to train and explore data mining models. This document explores the various aspects of mining structure usage, from creation to implementation.

What is a Mining Structure?

A mining structure is a metadata object that represents the data used for data mining. It links data sources to the algorithms that will process them. Key components of a mining structure include:

Creating a Mining Structure

Mining structures are typically created using SQL Server Data Tools (SSDT) for Analysis Services. The process involves:

  1. Connecting to your SSAS instance.
  2. Creating a new Analysis Services project or opening an existing one.
  3. Adding a new Mining Structure to the project.
  4. Defining the data source(s) and selecting the relevant tables or views.
  5. Mapping columns from the data source to the appropriate mining structure roles (Input, Predictable, Ignore).
  6. Configuring column properties, such as data type and content (e.g., Discretize, Sequence).
  7. Optionally, defining relationships between related tables.

Mining Structure Usage in Practice

Once a mining structure is defined, it serves as the foundation for creating and processing data mining models. Here's how it's used:

1. Model Creation

When you create a data mining model (e.g., Decision Trees, Clustering, Naive Bayes), you associate it with an existing mining structure. The model inherits the structure's data definition and column mappings.

2. Data Training

The mining structure dictates which data is used to train the model. During the processing phase, SSAS reads data from the defined sources, applies any transformations (like discretization), and feeds it into the chosen mining algorithm.

3. Model Exploration and Prediction

After a model is trained, you can use the mining structure to explore its contents and make predictions. The structure ensures that queries against the model use data that conforms to the original training schema.

4. Partitions for Performance and Management

Mining structure partitions allow you to divide the data into smaller, manageable sets. This is beneficial for:

Each partition can have its own data source view and filter. When processing a mining structure with partitions, you can choose to process all partitions or select specific ones.

Example: Using a Mining Structure for Customer Churn Prediction

Imagine you want to predict customer churn. You would create a mining structure using customer demographic data and their service usage history.

You might then create a Decision Tree model associated with this mining structure. The structure ensures that the Decision Tree algorithm receives properly formatted input for training and prediction.

Important Considerations:

Ensure data quality and relevance for the columns included in your mining structure. Incorrect or irrelevant data will lead to inaccurate models.

Understand the different content types for columns (e.g., Continuous, Discrete, Ordered Discrete, Sequence) as they significantly impact how algorithms process the data.

Managing Mining Structures

SSDT provides a visual designer for managing mining structures. You can:

Effective use of mining structures is crucial for successful data mining projects in SQL Server Analysis Services. By carefully defining and managing your mining structures, you lay the groundwork for building robust and insightful data mining models.

Tip:

For large datasets, consider using sampling or discretization to manage the size and complexity of data processed by mining structures and models.