SQL Server Development Bookmark and Share   
 index > Data Mining > PredictProbability with Association Rule model..
 

PredictProbability with Association Rule model..

I have run into a .. somewhat of a "duh" question. I'm running association rule to run a basket analysis,and I'm trying to get probability of each prediction. I know this is wrong, but how do I go about running PredictProbability on each ProductPurchase prediction?

When I run the below DMX query, I get this error message...

Error (Data mining): the dot expression is not allowed in the context at line 5, column 25. Use sub-SELECT instead.

Thanks in advance...

-Young K

SELECT
t.[AgeGroupName]
, t.[ChildrenStatusName]
, (Predict([Basket Analysis AR].[Training Product], 3)) as [ProductPurchases]
, (PredictProbability([Basket Analysis AR].[Training Product].[ProductName])) as [ProductPurchases]
From
[Basket Analysis AR]
PREDICTION JOIN
OPENQUERY([DM Reports DM],
'SELECT
[AgeGroupName]
, [ChildrenStatusName]
FROM
[dbo].[DM.BasketAnalysis.Contact]
WHERE isTrainingData = 0
') AS t
ON
[Basket Analysis AR].[Age Group Name] =t.[AgeGroupName]
AND [Basket Analysis AR].[Children Status Name] = t.[ChildrenStatusName]

Young K  Monday, November 20, 2006 7:16 PM

You can actually get the statistics directly from the Predict function call:

Note the extra flag for the Predict function (INCLUDE_STATISTICS) and the removal of the PredictProbability call. PredictProbability will not work for nested table columns

SELECT
 t.[AgeGroupName]
 , t.[ChildrenStatusName]
 , (Predict([Basket Analysis AR].[Training Product], INCLUDE_STATISTICS, 3)) as [ProductPurchases]
From
 [Basket Analysis AR]
 PREDICTION JOIN
 OPENQUERY([DM Reports DM],
 'SELECT
  [AgeGroupName]
  , [ChildrenStatusName]
 FROM
 [dbo].[DM.BasketAnalysis.Contact]
 WHERE isTrainingData = 0
') AS t
ON
[Basket Analysis AR].[Age Group Name] = t.[AgeGroupName]
 AND [Basket Analysis AR].[Children Status Name] = t.[ChildrenStatusName]

 The results results will include the probability/support and adjusted probability for each of the predicted items

 

Bogdan Crivat  Monday, November 20, 2006 11:30 PM

You can actually get the statistics directly from the Predict function call:

Note the extra flag for the Predict function (INCLUDE_STATISTICS) and the removal of the PredictProbability call. PredictProbability will not work for nested table columns

SELECT
 t.[AgeGroupName]
 , t.[ChildrenStatusName]
 , (Predict([Basket Analysis AR].[Training Product], INCLUDE_STATISTICS, 3)) as [ProductPurchases]
From
 [Basket Analysis AR]
 PREDICTION JOIN
 OPENQUERY([DM Reports DM],
 'SELECT
  [AgeGroupName]
  , [ChildrenStatusName]
 FROM
 [dbo].[DM.BasketAnalysis.Contact]
 WHERE isTrainingData = 0
') AS t
ON
[Basket Analysis AR].[Age Group Name] = t.[AgeGroupName]
 AND [Basket Analysis AR].[Children Status Name] = t.[ChildrenStatusName]

 The results results will include the probability/support and adjusted probability for each of the predicted items

 

Bogdan Crivat  Monday, November 20, 2006 11:30 PM
Thanks so much. :-D
Young K  Tuesday, November 21, 2006 2:04 AM

Hi,

I'm trying to do something similar (and yet, different...): I want to get the probability that a given item will be purchased by a customer.

I have a list of items I would like to promote, and I want to offer each client the Item he/she is most likely to buy - based on their past purchases.

The items from the "promotion" list are not necessarily in the list of recomendations given by the AssociationRules algorithm for the given client, but i would like to use this algorithm to predict the probability my client would buy each promoted item.

Since my list of products is very large (millions of items), I cannot use the Decision trees algorithm or try to make-do, somehow,with the recommendations provided by the Association rules.

Thanks for your help,

Yonatan Betzer

yonatan.betzer@gmail.com

YonatanBetzer1  Wednesday, September 03, 2008 11:54 AM

You can use google to search for other answers

Custom Search

More Threads

• Excel Data Mining Addin Error: Object not set to an instance of object
• Help: Error in metadata manager. The D Msample ~MC cube has no measure groups
• The SQL Server 2005 Data Mining Add-ins for Office local machine
• loss of milli second resolution between SQL Server 2005 and Excel
• How do I Retrieve Beta (Standardized Coefficient) from Microsoft Linear Regression
• analysis services 2000 (data mining)
• Association Rules algorithm, Help?
• How to calculate Profit value in Decision Tree Profit chart
• Full Text Search Engine and russian language support...
• Assign Cluster # to customers