Friday, March 30, 2012

predict product with sex and age of customer.

i have table:

customer(customerid, age,sex....)

orderdata(orderid, customerid,day)

orderdetails(orderid, productid, quantity)

products(productid, productname,...)

now, i want to show some product for customer when i now him age and sex.

e.ct: if he is a man and age =20 i show product : ball, pull, sport close....... if man is a woman , i show lips, babara, t_shirt, skirt....

if man is a chirdren, i will show joy, story for chidren....

how i create my mining model. and how i query for result in DTS

The easiest way would be first to create a view containing the customer information along with the order id, e.g.

orderid, age, sex, ...

Then you would create a model using that view as the case table, and adding a nested table for products. The product nested table should have a single column - the product id (or product name if you denormalize) - which will be the key. Make the table "PREDICT" (or input and output) and make the non-key columns (i.e. other than orderid) all inputs.

You will then be able to predict based on age and sex like this

SELECT FLATTENED TopCount(Predict(Products),$AdjustedProbability,5) FROM MyModel
NATURAL PREDICTION JOIN
(SELECT 25 as Age, 'Male' as Gender) AS t

No comments:

Post a Comment