MSDN > 論壇首頁 > Data Mining > Results of DMX queries in MovieClick association rules model
發問發問
 

問題Results of DMX queries in MovieClick association rules model

  • 2009年6月15日 下午 09:18Jeff06 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

    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

所有回覆

  • 2009年6月29日 下午 03:35Allan MitchellMVP使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     包含代碼
    Hi Jeff

    What results do you get for 

    SELECT Predict(Movies, 5) FROM MovieAssociation
    

    I am going to guess the exact same as you have currently.  The above query should give you most probable 5 movies selected in the model

    What your query is telling you I think is "look I couldn't really find anything interesting for you with the data you gave me so i am going to give you the model's most likely movies instead"

    Allan