Building a recommendation system that requires context enrichment

I’ve only taken 3 fast-ai lessons, so I’m still not at the point where I know how to produce an API that can provide user recommendations. But I’m curious how you approach prototyping a product like that. It’s very different, as far as I can tell, than the image classifier we’ve built in the first 2 lessons.

The image classifier training generates a model where all of the independent variables can be calculated from the image, so the user provides all of the parameter values by simply uploading the image.

But I wouldn’t think this is the case for a product recommendation or other predictions that use tabular data. The user is not providing a list of products to evaluate, the user is not providing in their request user tags or attributes that could be used for product recommendation. There may also be dynamic features about each product. A product might perform better when it’s raining or cold or when an alternative has an outage.

It’s also possible that the most accurate approach uses distance to specific users (like k nearest neighbor) rather than say user tags or clusters to score a recommendation. Surely you wouldn’t store info about specific users in a pkl file loaded into memory of the backend service. You would need to do database queries during the prediction.

So it seems there is work to building a recommendation system due to data retrieval. Data retrieval work not included in the image classifier we built. Is this accurate? If so, how does one go about building a recommendation system that utilizes parameters whose values are not provided by the user?