Analyzing product affinities

This tutorial introduces you to the Associations mining function. The sample data contains products of a retail bank per customer. With the Associations mining function, you can explore product affinities, for example, which product combinations occur together at the same customer.

The database DWESAMP needs to be prepared on the database server. See Preparing the data for the tutorials.

This tutorial shows how to use the Associations mining function to analyze product affinities of a bank.
  1. Create a new data warehousing project:
    1. On the toolbar of the Design Studio, click the New icon.
    2. On the Select a wizard window, select Data Warehousing > Data Warehousing Project and click Next.
    3. In the Project name field, type MiningTutorials and click Finish.
  2. In the MiningTutorial project, create a new mining flow for the associations analysis.
    1. Open the MiningTutorial project, right-click the Mining Flows folder, and select New > Mining Flow.

      The New Data Flow window is opened.

    2. In the Name of the mining flow field, type MarketBasketAnalysis and click Next.
    3. From the list of connections, select DWESAMP and click Finish.

      The mining flow MarketBasketAnalysis is added to the Mining Flows folder in the MiningTutorial project.

  3. Add operators from the Palette to the mining editor canvas:
    Tip: To quickly locate the required operator in the Palette, type the name of the operator in the Palette entry field, for example, Table Source.
    1. Place the Table source operator on the canvas.

      The Select Database Table window is opened.

    2. Expand the BANK schema, select the CUSTOMER_PRODUCTS table, and click Finish.

      In this tutorial, the Db2® table to be analyzed contains a list of products for each bank customer.

    3. In the Table source operator, click the plus (+) icon to display the columns of the table.
    4. Place the Associations operator to the right of the Table source operator.

      The Associations operator finds product affinities.

    5. Connect the operators in the canvas by clicking the Output Port of the Table Source operator and dragging the connection to the Input Port of the Associations operator.
  4. Edit the Associations operator properties:
    1. In the canvas, select the Associations operator.

      The Properties view of the Associations operator is displayed.

    2. On the Properties page, click Model Name.
    3. In the Model name field, type ProductAffinities as model name for the new model.
    4. Click the Mining Settings tab.
    5. In the Group column list, select CLIENT_ID to specify all products for one customer to represent one item set.
  5. Add a Visualizer operator to the canvas to open a graphical view of the association rules:
    1. Place a Visualizer operator on the canvas to the right of the Associations operator.
    2. Connect the operators on the canvas. From the Palette, click Connection. Click the Association's Model port and then click the Visualizer's Model port.
  6. Execute the mining flow in the database and analyze the association rules to see the product affinities.
    1. Click the Execute Mining Flow icon on the toolbar. The Execution of Flow window opens.
    2. Accept the default values and click Execute. The Mining Flow Execution status window opens. Upon completion, the Association Visualizer window opens with several views to display the association rules. The Rules view is a tabular view that shows one rule in each row with measures about the relevance and quality of the rule.
    3. Click Graph to open the graphical view. In the graphical view of our scenario, the different products are represented as nodes and the associations between the products are represented as arrows. Color and width of the rules show relevance and quality of the rules as indicated in the legend below the graph.
    4. Close the association model.
    5. In the Data Output area, you see the status and action of the execution process. In the Data Source Explorer, you see that the mining model that was just visualized is stored in the RULES database.


Feedback