PredictAssociation returns input items even with the exclusive option!

คำตอบ PredictAssociation returns input items even with the exclusive option!

  • Monday, December 03, 2012 2:00 PM
     
      Has Code

    Hi guys,

    I have a strange behavior with SQL Server 2012 Enterprise Edition.

    Here is my data structure:

     

    Basic Association model with nested table for products.

    I am issuing the following query:

    SELECT flattened c.customerid, c.[name], PredictAssociation(Product, input_only) as Input, PredictAssociation(Product, 5, exclusive) AS Recommendation
    FROM Customer
    PREDICTION JOIN
    SHAPE
    {
    OPENQUERY ([Adventure Works2012],
    'SELECT customerid, [name], gender, age FROM Customer
    ORDER BY customerid')
    }
    APPEND
    (
    {
    OPENQUERY ([Adventure Works2012],
    'SELECT customerid, productname FROM product
    ORDER BY customerid')
    }
    RELATE customerid To customerid
    )
    AS product AS c
    ON
    Customer.gender = c.gender
    AND Customer.age = c.age
    AND Customer.product.productname = c.product.productname 

    The problem is that in the predicted results I get products from the input (i.e. products customer already has).

    Here is a sample (sory for the cyrillic):

    Any ideas?
     

     


    • Edited by Rinshwind Monday, December 03, 2012 2:01 PM
    •  

All Replies

  • Monday, December 03, 2012 2:42 PM
     
     
    Just created the same project on SQL Server 2008 R2 Standard - exactly the same behavior. Am I missing something?
  • Tuesday, December 04, 2012 11:52 AM
     
     Answered

    OK, I think I figured it out.

    1st: it's good to filter the predictions to only rule based (not including popular results) - WHERE $NODEID<>''

    2nd: since I have 3 demographic attributes marked as inputs there are rules / sets that include demographic attributes + 1 product which predicts the other product - thus the product predicted is still not in the input! It seems that the exclulsive option works row by row - not for the entire set.

    So either I must force bigger sets or get rid of the demographics in general. Another option would be to check programatically for doubling.

    Any thoughts would be appreciated.


  • Wednesday, December 05, 2012 7:27 AM
    Moderator
     
     

    Hi Rinshwind,

    Thank you for sharing your solutions and experience here. It will be very beneficial for other community members who have similar questions.

    Thanks,
    Eileen

    If you have any feedback on our support, please click here


    Eileen Zhao
    TechNet Community Support