Question

I have a multi-class neural network classifier that has K classes(products). For every row, only one of the classes will be 1 at a time. Now, this approach works fine if I have only 1 objective to optimize i.e Which of these N products was "clicked" by the user.

But how will I solve this problem if I need to optimize on a 2nd objective i.e Which of these N products was "purchased" by the user?

A purchase event is always preceded by a click event. I can obviously solve this problem by training two separate models - 1 for click and the other for purchase. But purchase data is very low as compared to the click data. And we ran the purchase model on production. It did not perform well.

So how do I take both the click and purchase data and frame my problem as "Which of these N products will be clicked and possibly purchased by the user"? and train a single model.

Any sources or papers in this direction will be really helpful.

Was it helpful?

Solution

What you're referring to is called multi-task learning, where your goal is to have a single network learn multiple tasks (in your case "click" and "purchase").

The benefit of having a single model learn both tasks is that the network can use information extracted for one task to improve its performance on the other.

Technically you need your network to have two output layers (i.e. one for predicting "clicks" and one for "purchases") and likewise two loss functions (one for each objective). These loss functions usually contribute equally towards the total loss, unless you don't want to consider both tasks of equal importance.

If you're using keras an example for multi-output models can be found here.

Licensed under: CC-BY-SA with attribution
Not affiliated with datascience.stackexchange
scroll top