Error Encountered When Running add_lift_test_measurements with time_varying_media=True

I am using the time_varying_media=True option in the MMM model from the pymc-marketing library. When I attempt to run add_lift_test_measurements, I encounter a KeyError related to missing columns, specifically date.

KeyError: “None of [MultiIndex([(0, ‘channel_1’),\n (1, ‘channel_1’),\n (2, ‘channel_1’)],\n names=[None, ‘channel’])] are in the [index]”

  • The error occurs only when time_varying_media=True is enabled.
  • When time_varying_media=False, this issue does not occur.
  • Even after adding the date column explicitly to the df_lift_test input, the error persists, indicating that the issue isn’t resolved by simply including this column.

How should I structure the lift test and calibration process to work correctly with time_varying_media=True? Is there a specific requirement or additional step needed to ensure that the date column is handled properly?

Thanks for reporting @terier99 ! We will push a fix very soon in 0.11.0, see keep date column in test_scale_lift_measurements by malitsadok1 · Pull Request #1316 · pymc-labs/pymc-marketing · GitHub :slight_smile:

1 Like

Thank you for your response. I’m looking forward to the next version!

Already released!

1 Like