New user recommendations are wrong, but I don't know how to adjust them

0

I am currently looking to create a system to recommend items in a certain game.
To briefly explain this game, there are rounds, and for each round, the player selects and purchases a number of items from a list of candidates presented to them. In this way, you build your build and fight against your opponent in each round. I would like to create a system that displays which items to purchase.

First, I input the history of items actually purchased by the user into ItemInteractions in personalize. A sample of this data and schema is at the bottom of this page. I also pass the metadata of which round the item was purchased as metadata.I chose Custom for Dataset's Domain. Data analysis of the Item Interactions dataset is also written at the bottom.

I then created a Campaign and displayed a recommendation for a new user's (id:9999) item from the console.
And this worked well, showing the items that, from my point of view, would be purchased first and foremost.
So next, I purchased this recommended item and told the 9999 user that the item was purchased by the 9999 user with put_events.This put_events code is also written at the bottom.
Then I displayed the recommendation again. Then the item displayed changed from the last time, so I purchased the top recommendation and again told the user that he/she had purchased the item with put_events.
Here I realized the problem. No matter how many put_events I do, the recommended items are almost the same as the items the average player buys in the first round.
Also, if I buy a recommended item 3-4 times, the same item seems to show up over and over again.
It is common in this game to buy the same item over and over again, but even taking that into account, I found it to be too much.
Also, if you buy as recommended, it is obviously not the same as a normal build.

But I do not know how I can tune it to solve this problem.
I would appreciate it if you could answer my question.

  • Sample Item Interactions
USER_ID,ITEM_ID,TIMESTAMP,ROUND
1,14,1672588800,1
1,23,1672588800,1
1,26,1672588800,1
1,27,1672588800,1
1,2,1672610400,1
1,24,1672610400,1
1,21,1672592400,2
1,26,1672592400,2
1,13,1672592400,2
....
  • Schema for Item Interactions
{
	"type": "record",
	"name": "Interactions",
	"namespace": "com.amazonaws.personalize.schema",
	"fields": [
		{
			"name": "USER_ID",
			"type": "string"
		},
		{
			"name": "ITEM_ID",
			"type": "string"
		},
		{
			"name": "TIMESTAMP",
			"type": "long"
		},
		{
			"name": "ROUND",
			"type": "string",
			"categorical": true
		}
	],
	"version": "1.0"
}
  • put_events code
        client = boto3.client('personalize-events')
        response = client.put_events(
            trackingId=trackingId,
            userId='9999',
            sessionId='aaa1',
            eventList=[
                {
                    'eventType': 'string',
                    'sentAt': 1716658547,
                    "itemId": "1",
                    "properties": '{"round":"4"}'
                },
            ]
        )
  • Data analysis of the Item Interactions dataset
Number of rows
8716
Number of unique users
205
Number of unique items
82
User interaction history distribution
Users with less than 2 interactions
0
Users with 2 to 15 interactions
15
Users with 16 to 31 interactions
42
Users with more than 31 interactions
148
asked 6 months ago163 views
2 Answers
1

Hi!

When you use Amazon Personalize and the user personalization recipe, the model learns from your data. If people tend to repeatedly buy the same item, that is what will be recommended. However there are ways you can further control this. I recommend looking at the Amazon Personalize promotions feature (https://aws.amazon.com/blogs/machine-learning/customize-your-recommendations-by-promoting-specific-items-using-business-rules-with-amazon-personalize/). You can for instance create a promotion so that 50% (or a different percentage that makes sense for your business) are of items the user has not purchased before but that are still relevant for this user. You do this by creating a filter on the interactions for not purchased items and then applying a promotion. This way you can keep the personalization, but also enforce some variability.

Also regarding the "round" metadata, I wanted to check: are you also sending the "round" metadata when you do the getRecommendations request? This is the only way this context can be taken into account i.e. if there is a difference in behaviour in different rounds. Amazon Personalize can then know what round you are requesting recommendations for. I assume you are doing this already, but wanted to confirm.

AWS
answered 6 months ago
  • Anna_G, thank you for all your answers. I wrote in the answer section because of the length of the reply.

0

Anna_G, thank you for all your answers.
Thank you for the details about the promotion.
However, I personally do not want to control with promotions.
Because buying the same items over and over is normal for specialized builds.
So I think it is difficult to control them because I believe it is a case by case basis whether you want to prioritize unpurchased items or not.

Thanks also for the metadata on ROUND.
I only get recommendations from the AWS console, and I mistakenly thought the API was the same since there was no way to send a context in the console.
So I used getRecommendations to send the round. The source code is at the bottom.
However, the result was not so different from before.
Indeed, the response changed partially but not significantly after adding "round".
The results are shown here.Note that this user has learned put_events up to round 4.

  • round5
[{'itemId': '1', 'score': 0.0555667}, {'itemId': '27', 'score': 0.0506263}, {'itemId': '26', 'score': 0.0473667}, {'itemId': '13', 'score': 0.0452561}, {'itemId': '5', 'score': 0.0447644}, {'itemId': '2', 'score': 0.0427049}, {'itemId': '25', 'score': 0.0395148}, {'itemId': '23', 'score': 0.0380003}, {'itemId': '24', 'score': 0.035642}, {'itemId': '31', 'score': 0.0340813}, {'itemId': '9', 'score': 0.030955}, {'itemId': '17', 'score': 0.0269283}, {'itemId': '21', 'score': 0.0264517}, {'itemId': '8', 'score': 0.025525}, {'itemId': '4', 'score': 0.0212729}, {'itemId': '16', 'score': 0.0212536}, {'itemId': '57', 'score': 0.0180247}, {'itemId': '34', 'score': 0.0167012}, {'itemId': '32', 'score': 0.0159745}, {'itemId': '38', 'score': 0.0156481}, {'itemId': '14', 'score': 0.0148284}, {'itemId': '35', 'score': 0.0143579}, {'itemId': '29', 'score': 0.0143412}, {'itemId': '36', 'score': 0.0135814}, {'itemId': '89', 'score': 0.0128924}]
  • round6
[{'itemId': '1', 'score': 0.0544268}, {'itemId': '27', 'score': 0.0537215}, {'itemId': '13', 'score': 0.0468896}, {'itemId': '2', 'score': 0.0449484}, {'itemId': '26', 'score': 0.0443178}, {'itemId': '5', 'score': 0.0435288}, {'itemId': '25', 'score': 0.0384676}, {'itemId': '24', 'score': 0.036648}, {'itemId': '23', 'score': 0.0359846}, {'itemId': '31', 'score': 0.0338005}, {'itemId': '9', 'score': 0.0292327}, {'itemId': '17', 'score': 0.0267265}, {'itemId': '21', 'score': 0.0256245}, {'itemId': '8', 'score': 0.0241058}, {'itemId': '4', 'score': 0.0223789}, {'itemId': '16', 'score': 0.0206327}, {'itemId': '57', 'score': 0.0185087}, {'itemId': '38', 'score': 0.015731}, {'itemId': '34', 'score': 0.0156028}, {'itemId': '32', 'score': 0.0153947}, {'itemId': '14', 'score': 0.0151968}, {'itemId': '35', 'score': 0.0151828}, {'itemId': '29', 'score': 0.0141279}, {'itemId': '89', 'score': 0.0137972}, {'itemId': '36', 'score': 0.0132845}]
  • round7
[{'itemId': '1', 'score': 0.0562894}, {'itemId': '27', 'score': 0.0526726}, {'itemId': '26', 'score': 0.0510002}, {'itemId': '2', 'score': 0.0483601}, {'itemId': '13', 'score': 0.0460107}, {'itemId': '5', 'score': 0.0459036}, {'itemId': '25', 'score': 0.0381629}, {'itemId': '23', 'score': 0.0370996}, {'itemId': '24', 'score': 0.035449}, {'itemId': '31', 'score': 0.0332316}, {'itemId': '9', 'score': 0.028743}, {'itemId': '17', 'score': 0.0247091}, {'itemId': '8', 'score': 0.0243327}, {'itemId': '21', 'score': 0.0241129}, {'itemId': '4', 'score': 0.0223307}, {'itemId': '16', 'score': 0.0216642}, {'itemId': '34', 'score': 0.0174355}, {'itemId': '57', 'score': 0.0171976}, {'itemId': '14', 'score': 0.016023}, {'itemId': '32', 'score': 0.0157753}, {'itemId': '38', 'score': 0.0151056}, {'itemId': '35', 'score': 0.0140179}, {'itemId': '29', 'score': 0.013737}, {'itemId': '36', 'score': 0.0134809}, {'itemId': '89', 'score': 0.0116171}]
  • round16
[{'itemId': '1', 'score': 0.0540789}, {'itemId': '27', 'score': 0.0495268}, {'itemId': '26', 'score': 0.049191}, {'itemId': '13', 'score': 0.0485498}, {'itemId': '2', 'score': 0.0482758}, {'itemId': '5', 'score': 0.0445756}, {'itemId': '25', 'score': 0.0391537}, {'itemId': '23', 'score': 0.0371481}, {'itemId': '24', 'score': 0.0362455}, {'itemId': '31', 'score': 0.0316734}, {'itemId': '9', 'score': 0.0288406}, {'itemId': '17', 'score': 0.0251541}, {'itemId': '21', 'score': 0.0235289}, {'itemId': '8', 'score': 0.0233633}, {'itemId': '4', 'score': 0.0221425}, {'itemId': '16', 'score': 0.0208343}, {'itemId': '57', 'score': 0.0171059}, {'itemId': '34', 'score': 0.0170289}, {'itemId': '14', 'score': 0.0158862}, {'itemId': '38', 'score': 0.0153976}, {'itemId': '32', 'score': 0.0153184}, {'itemId': '35', 'score': 0.0144443}, {'itemId': '29', 'score': 0.0138999}, {'itemId': '89', 'score': 0.0129483}, {'itemId': '36', 'score': 0.0128481}]

In this way, it seems that the round data is not taken into account very much.

How can I get the results I want from these things?
I apologize for relying on you, but I would appreciate your response.

  • GetRecommed code
        client = boto3.client('personalize-runtime')
        response = client.get_recommendations(
            campaignArn="arn:aws:personalize:ap-northeast-1:620988379686:campaign/mycampaign",
            userId="10001",
            context={"round": "16"}
        )
answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions