SQL Server Developer Center > SQL Server Forums > Data Mining > Prediction for a rule derived from market basket analysis (DMX).
Ask a questionAsk a question
 

AnswerPrediction for a rule derived from market basket analysis (DMX).

  • Friday, October 23, 2009 8:30 AMKatie Malecka Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    I would like to solve the following issue: I have {transaction_id; customer_id} as the case table, and {transaction_id; product} as the nested table. I have used the association rules to get the most important market basket product correlations. What I want to do in the next step is:- given a specific rule (for instance: beer, crisps -> water), prepare the list of customers who are most likely to support this rule, preferably with some kind of a probability/importance measure. I figured I would use the existing mining structure and create a new mining model and select the nested table (products) as "input" and the customer_id column in the case table as "predict only". Then I proceeded to write a DMX query to get the list + probabilities. I can't seem to get a proper result, though -- with the PREDICT function in the singleton query, I get only 1 customer_id result while I'm pretty confident more people should be listed for the given query input. I guess I chose a wrong approach for this problem, can anyone hint at a better solution for this task? Thanks.

    Katie
    • Edited byKatie Malecka Friday, October 23, 2009 8:35 AMcolumn name correction
    •  

Answers

  • Friday, October 23, 2009 2:20 PMrok1 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer



    Have you tried using topcount function with predicthistogram?

    topcount (predicthistogram ([AssociationModel].[CustomerID]),$probability ,5)as PredictedCustomer

     

     

     

     

    hth

     

     

    Rok

All Replies

  • Friday, October 23, 2009 2:20 PMrok1 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer



    Have you tried using topcount function with predicthistogram?

    topcount (predicthistogram ([AssociationModel].[CustomerID]),$probability ,5)as PredictedCustomer

     

     

     

     

    hth

     

     

    Rok

  • Saturday, October 24, 2009 4:27 AMKatie Malecka Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    This is what I was looking for. Thank you very much, rok1!