Closed virithavanama closed 2 years ago
Hello! I might need a bit more information, let me ask a few questions to see what is going on:
It could be that there is some misalignment between the budget provided, the prices and the bounds. Could you share what values you have provided for those arguments? Or check they are in sync with one another.
Hi, Optimization just gave warning as shown in attached image and output is "Singular matrix E in LSQ subproblem (Exit mode 5)". I'm passing media cost in media_data, all the values i have passed are in the attached screenshot.
Can you confirm the model converged? (rhats
in the print_summary
are less than 1.1
) Just to rule that out first.
Yes r_hat values are less than 1.1
Apologies for the late response. Thanks for checking that!
Generally that error would be (at least in this scenario) related to the constraint, in this case the budget constraint.
Can you show what the response curves look like?
I have attached the response curves. But I have few questions:
Hi Team,
I'm facing the same issue when running 'find_optimal_budgets'. Screenshots from the run:
Input -
Run -
Model Summary -
Response Curves -
Thank you!
Hi Pablo, Thanks for the response. I'm still facing the same issue. "/content/notebooks/scipy/optimize/_numdiff.py:579: RuntimeWarning: invalid value encountered in true_divide J_transposed[i] = df / dx Singular matrix E in LSQ subproblem (Exit mode 5) Current function value: nan" Have made all the changes you have suggested and r_hat is less than 1.1 Actually if i use data windowing for a specific range it is giving this error but when i take complete data this error is occurring. What is the reason for this error and what are the measures to be taken to avoid this?
Can you further ellaborate on this sentence:
Actually if i use data windowing for a specific range it is giving this error but when i take complete data this error is occurring.
Basically if a channel has 0 as the media cost for many weeks, we are getting this error. If we select a period with relatively less 0s its working
Could you show me the output of the following calls:
from lightweight_mmm import optimize_media
starting_values = optimize_media._generate_starting_values(
n_time_periods=n_time_periods,
media=media_mix_model.media,
media_scaler=media_scaler,
budget=budget)
and
bounds = optimize_media._get_lower_and_upper_bounds(
media=media_mix_model.media,
n_time_periods=n_time_periods,
lower_pct=0.2,
upper_pct=0.2,
media_scaler=media_scaler)
Since the media optimisation can be sensitive to user input I might provide so more debug options in the future.
Closing due to inactivity, feel free to re-open if there are any questions/issues left.
Hi Team,
Thanks in advance