Hi,
I'm trying to practice DMX on association rules. I have deceloped the MovieAssociation model on MovieClick database as per "data mining with SQL Server 2008" book. I tried the DMX provided by the book as well as the DMX simillar to what has been recommended in a posting here. I get no errors but I get odd results for any of the queries below. It sounds like it's giving just the 5 top purchased movie regardless of what I query. Am I missing something here?
Thanks
// (here Outcome recommendation is same for all customers)
SELECT T.CustomerID, Predict(Movies, 5) AS Recommendation
FROM MovieAssociation
NATURAL PREDICTION JOIN
OPENQUERY([Chapter 11],
'SELECT CustomerID, Gender, [Marital Status] FROM Customers') AS T
//Result: (for all customrt IDs)
//Star wars
//Matrix, The
//Lord of the Rings: The Fellowship of the Ring, The
//A beautiful mind
//Star Wars Episode V: Empire Strikes Back
//(here I get same result below for queries regardless of gender type I mention)
SELECT Predict(Movies, 5) FROM MovieAssociation PREDICTION JOIN
( SELECT 'Female' AS gender) AS T
ON MovieAssociation.gender = T.gender
//Result: (for both male or female options)
//Star wars
//Matrix, The
//Lord of the Rings: The Fellowship of the Ring, The
//A beautiful mind
//Star Wars Episode V: Empire Strikes Back
SELECT Predict(Movies, 5) FROM MovieAssociation
PREDICTION JOIN
(select 'male' as gender, (SELECT 'star wars' AS movie union select 'big' AS Movie) as Movies) as T
ON MovieAssociation.gender = T.gender
and MovieAssociation.Movies.Movie= T.Movies.movie
//Result: (for both male or female options)
//Star Wars Episode V: Empire Strikes Back
//Star Wars Episode VI: Return of the Jedi
//Star wars
//Matrix, The
//Lord of the Rings: The Fellowship of the Ring, The