# Optimize an objective based on a trained model

I want to find a joint optimal subset based on individual scores from a predictive model.

Example: Say I have a set of customers and a set of products. And I have trained a model for predicting the purchase probability of individual products for each customer, ie $$P(purchase \ p_i | X)$$, where $$X$$ is some feature vector.

I want to advertise different subsets of products to different customers in such a way that the subsets I choose for the customers is going to maximize the joint probability of purchasing the products in the chosen subset.

Because product purchases are not independent of each other, it should not just be the set of highest scoring products for the individual customer. The conditional probability of purchasing $$p_2$$ given that I advertised $$p_1$$ is not necessarily the same as the probability of purchasing $$p_2$$ unconditionally.

So given that I advertised $$p_1$$, I want to find something like:

$$\underset{p_i}{\operatorname{argmax}} P(purchase \ p_i| p_1)$$

And when I find that one, say the result is $$p_2$$, I want:

$$\underset{p_i}{\operatorname{argmax}} P(purchase \ p_i| p_1,p_2)$$ etc..

Is there a way to find a good solution to this problem in practice given large amounts of data on offers and the scores from the model? IAny relevant resources to read/watch would be appreciated.

This is related to this question:

optimal subset / joint distribution prediction with machine learning