TransWikia.com

How to handle non-numeric user id's in a recommendation model

Data Science Asked by Yaya on October 1, 2021

Hi i’m working on a practice project on amazon movie reviews and i did everything that was asked except building a model that will recommend movies to users which have not been watched nor been rated. but when i’m trying to train and split the model I have a problem on assigning x/features and y/target as user_id’s are not numeric e.g ‘A3R5OBKS7OM2IR’. (The data contains 207 columns with user_id column which contains 4.9k users and 206 movies(movie 1 to movie 206 with ratings corresponding with the respected user_id)

2 Answers

I'm not sure why you would include user ID as a predictive variable, unless there is specifically some part of the user ID that gives you information. For example, maybe the first three letters tell you that the user is a premium user and then you could feature engineer a category from that.

Answered by Victor Ng on October 1, 2021

If you want to assign any non-numeric value to a numeric value, you'll can hash them.

In Python, it would look like:


user_id = "A3R5OBKS7OM2IR"

user_id_numeric = hash(user_id)

Answered by Brian Spiering on October 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP