How to #8: Multi-treatment and optimal policy with EconMl and DoWhy

Adam Davis
3 min readFeb 22, 2024
Claude Monet. Vétheuil en été, 1879

“I’m hard at it, working stubbornly on a series of different effects, but at this time of the year the sun sets so fast that it’s impossible to keep up with it” — Claude Monet

Breakdown:

Building off of the previous entry of the How To series, we take a look at using multiple treatments or investments. The goal would be to maximize the potential revenue for the hotel which is the room rate multiplied by the total stay. The treatments will be allowing the deposit to be refundable as well as a discount of 10% of their room rate.

As this is from a previous project I will include what is specific to this problem. The code is at the bottom of the article.

Treatments and outcome with heterogeneous variable/s:

Let’s see the average lead time average for each treatment combination:

Next is to encode the multiple treatments into one array:

Following to set the model as well:

The resulting graph created with DoWhy:

Treatment Plan:

It is up to us to create a treatment plan. This could be a flat fee or credit that we give to both the refund and discount. This is essentially the cost to the business of instituting each treatment.

The cost of the refund or not goes off of the previous cancellations. As it is a negative value it is a penalty to the customer based off of the amount of cancellations that they have. No previous cancellations, no penalty. Each one is $10. The discount for the customer is 10% off of their total charge. A way to visualize this is we are giving them 10% of their room charge back to them. This comes from the average total charge.

We can see the allocations of the optimal treatment plan:

We can see that most have only Discount as a strategy followed by Refund & Discount followed by Refund_Status in third. The metrics to test the robustness of the model are the same as previously so they will not be listed here.

To End:

Using both EconMl and DoWhy enables us to more closely find the causal effects of a causal model without using solely regression methods. The end output for this method is how to best treat the customers to maximize our revenue. We have the data of booked guests who have not paid yet. We have their information on the type of hotel as well as if they have previous cancellations as well. Who received the discount as well as the refund status.

The point of the model learning from the data is to gauge the effect of the treatments of the penalty on the cancellations and the discount on the total charge. This can allow us to look at who was recommended for which treatment and better understand that group as well. This depends on the business needs.

--

--