What methods exist to identify the optimal splits in some exogenous variable, such that a dependent variable is maximized? I've come across an interesting problem recently, and I'm wondering if I'm missing some obvious approach here. The problem statement is thus:
Imagine I run an online business, and I'm interested in restructuring my pricing model such that the price a user sees is dependent on say, age (or some other 'well-behaved' variable that we can assume is known to me — ignore the ethical considerations for now, I'm going with age for the sake of simplicity). So, I run a test over the course of a few weeks where I randomly assign users to one of four price variants, and I collect data on how each variant converts users:

*

*Variant 1: \$2.99/month

*Variant 2: \$4.99/month

*Variant 3: \$6.99/month

*Variant 4: \$8.99/month

The question is, given a users age, what's the optimal variant to assign the user?

I've thought of a couple of approaches so far, but I'm curious if there's a 'go-to' method here that I'm missing. My ideas so far are:

*

*Create four linear regression models of form $\text{Revenue}_{\text{user}} \sim \text{age}_{\text{user}}$, one for each variant. I can then plug each user's age into each model, and select the variant whose model produces the highest predicted revenue. However, I am unsure if this is an appropriate way to specify the linear model, as $\text{Revenue}_{\text{user}}$ is heavily zero-inflated.

*Bucket the users into age quantiles, and then identify the variant in each quantile that maximises revenue. This is conceptually simple, but also prone to overfitting. There is also the question of how many quantiles do I use?, which isn't immediately obvious.

I'm wondering if either a) a Bayesian approach or b) a ML-based approach (using something like a RF) could work here?

Your tests have given you a lot of data, including the user's age (and/or other characterstics), the price variant they were offered, whether they converted, and what revenue resulted.
Feed all of this into one large model. If you are concerned about the zero inflation, you could use a zero inflated model. Or simpler, model the probability of conversion with a logistic model, and the resulting revenue conditional on conversion with a straightforward OLS model (or using gamma regression, or similar). But if all you are interested in is expected revenue, then a simple regression will already get you 95% of the way.
Now you are faced with a new user. Evaluate your model four times, once with each price variant (and of course including all the other predictors you have on the user, or anything else). This will give you the expected revenue for each price variant. Pick the largest.
Of course, if you just feed everything into a model as-is, you will always pick a single price variant, since the uplift between price variants does not depend on the age. So you will need to include interaction terms between age and price variants (and any others that occur to you, too).
For bonus points, consider a spline transform of age to model nonlinearities. You can do this with other models as well. I would try a Random Forest, which is good at modeling interactions.
