Data science Linear regression Python Public



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, based on data about previous marketing campaigns in which 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