Showing posts with label figure. Show all posts
Showing posts with label figure. Show all posts

Friday, March 30, 2012

Personalization rather than Association

I'm trying to figure out how to build a personalization engine.

If my structure is built with users as case, and products as nested - I’d like to predict best products per user (rather than associated products), and If possible, ignoring products he already bought.

How do I do it?

After building the Association model with Users as Case, Products as Nested, a Prediction join query on the model with the same dataset as the training case will give you a set of suggested products for every user, ignoring the products he already brought (since they will be part of the input case for each user). This might be what you're looking for.

Please let me know if this does not work for you

|||As Shuvro says, associative prediction is personalization as you need it. If you build an associative model and then perform a prediction based on an individual's product list, you will get the "personalized" list of products for that user by default excluding the items already in the basket.|||

Shuvro

I don't have the DMX skills, yet, to do this directly. Can the same results be achieved using the DM wizard? If not could you please point me to an example of the statement that would be required?

Geoff

|||

Yes, you can get the results using the DM query wizard by joining the model to a case table which contains per user products. Open the "Mining Model Prediction" tab, select the Association model and the Case/Nested table under Input Tables, verify that the column mappings are correct and select the function "PredictAssociation" under Field.

You can also look at the tip posted at http://www.sqlserverdatamining.com/DMCommunity/TipsNTricks/1861.aspx for an example on how to perform a DMX query for this scenario.

|||Thank you!

Personalization rather than Association

I'm trying to figure out how to build a personalization engine.

If my structure is built with users as case, and products as nested - I’d like to predict best products per user (rather than associated products), and If possible, ignoring products he already bought.

How do I do it?

After building the Association model with Users as Case, Products as Nested, a Prediction join query on the model with the same dataset as the training case will give you a set of suggested products for every user, ignoring the products he already brought (since they will be part of the input case for each user). This might be what you're looking for.

Please let me know if this does not work for you

|||As Shuvro says, associative prediction is personalization as you need it. If you build an associative model and then perform a prediction based on an individual's product list, you will get the "personalized" list of products for that user by default excluding the items already in the basket.|||

Shuvro

I don't have the DMX skills, yet, to do this directly. Can the same results be achieved using the DM wizard? If not could you please point me to an example of the statement that would be required?

Geoff

|||

Yes, you can get the results using the DM query wizard by joining the model to a case table which contains per user products. Open the "Mining Model Prediction" tab, select the Association model and the Case/Nested table under Input Tables, verify that the column mappings are correct and select the function "PredictAssociation" under Field.

You can also look at the tip posted at http://www.sqlserverdatamining.com/DMCommunity/TipsNTricks/1861.aspx for an example on how to perform a DMX query for this scenario.

|||Thank you!

Wednesday, March 28, 2012

Perplexing Problem with tsql join.

I have been trying to figure this out for some time and I am sure there
must be an easier way than using a cursor. Given the following table
(simplified example):
ID CUSTID DTE
1 1 7/1/05
2 1 9/1/05
3 2 6/1/05
4 2 10/25/06
5 3 5/2/05
6 3 5/2/06
7 4 5/5/05
Return the max dte value record for each custid
So ie the return recordset would contain the following:
ID CUSTID DTE
2 1 9/1/05
4 2 10/25/06
6 3 5/2/06
7 4 5/5/05
Thanks in advance.
PaulYou could have more 1 or more records for each custid in my example
table I forgot to create on custid with 3 records.|||The following would work of course but what if you had another column
that could not be calculated by an aggregate column.
select max(id) id,cid,max(dte) dte from fred group by cid
for example lets add the folowing random values to column rnd
ID CUSTID DTE RND
1 1 7/1/05 32
2 1 9/1/05 42
3 2 6/1/05 68
4 2 10/25/06 2
5 3 5/2/05 5
6 3 5/2/06 9
7 4 5/5/05 3
8 3 6/2/06 7
So the return set would now include
ID CUSTID DTE RND
2 1 9/1/05 42
4 2 10/25/06 2
8 3 6/2/06 7
7 4 5/5/05 3|||Try,
select a.*
from t1 as a inner join (select custid, max(dte) as max_dte from t1 group by
custid) as b on a.custid = b.custid and a.dte = b.max_dte
AMB
"firebalrog" wrote:

> I have been trying to figure this out for some time and I am sure there
> must be an easier way than using a cursor. Given the following table
> (simplified example):
> ID CUSTID DTE
> 1 1 7/1/05
> 2 1 9/1/05
> 3 2 6/1/05
> 4 2 10/25/06
> 5 3 5/2/05
> 6 3 5/2/06
> 7 4 5/5/05
> Return the max dte value record for each custid
> So ie the return recordset would contain the following:
> ID CUSTID DTE
> 2 1 9/1/05
> 4 2 10/25/06
> 6 3 5/2/06
> 7 4 5/5/05
> Thanks in advance.
> Paul
>|||Thanks for the quick response. That is exactly what I needed. I forgot
you could use a query as part of the join. And even if I did I don't
think that I would have thought of using it in that way. Thats
beautiful. Now I will have to go through all my stored procedures and
check for places where I was using a cursor method to look for those
records in that type of situation.
Thanks again.