Data science Linear regression Python Public New



Implement the desired_marketing_expenditure function which returns the required amount of money that needs to be invested in the new marketing campaign in order to sell the desired number of units.

The data from previous marketing campaigns can be used to evaluate how the number of units sold lineraly depends on the amount of money invested.

For example, for the desired number of 60,000 units sold and previous campaign data from the table below, the function should return 250,000.

Previous campaigns
CampaignMarketing expenditureUnits sold
Python 3.6.2

  •   Example case: Wrong answer
  •   Linear dependency without error: Wrong answer
  •   Linear dependency with error: Wrong answer