February 2018
Intermediate to advanced
450 pages
11h 27m
English
Let's say we have unseen data of TV ad spending and that we want to know their corresponding impact on the sales of the company. So, we need to use the learned model to do that for us. Let's suppose that we want to know how much sales will increase from $50000 of TV advertising.
Let's use our learned model coefficients to make such a calculation:
y = 7.032594 + 0.047537 x 50
# manually calculating the increase in the sales based on $50k7.032594 + 0.047537*50000
Output:
We can also use Statsmodels to make the prediction for us. First, we need to provide the TV ad value in a pandas DataFrame since the Statsmodels interface expects it:
# creating a Pandas DataFrame to match Statsmodels interface ...Read now
Unlock full access