Visual Networks: The Marketing Consultant

Understanding non-linear relationships and marketing shenanigans

Italo Sayan
Towards Data Science

--

There are many reasons why neural networks have been successful at classifying images and creating original text. A few of the reasons are cheap training costs, scalable implementations, and investments in the field. One that is particularly interesting is their ability to capture non-linear relationships. Some examples of this type of relationships are tax brackets and income, tariffs and trade volume, your mid-year company bonus with sales, population count and time, etc. Phrases like “it doubles after this point” or “it gets increasingly worst” are hiding non-linear relationships.

Tax Brackets and Income
Tax Brackets(y) and Income(x)

On the other hand, linear relationships are straight forward. Think of salary and hours worked as an example. The more time you clock-in the higher the deposit you get at the end of the month. Simple enough, with an hourly rate of $10 you can make $70 with 7 hours of work.

Marketing investments are not straight forward. The way companies spend on advertising and their returns are certainly non-linear. Let's try to use neural networks to capture that relationship.

Imagine you had the marketing investment and budget of hundreds of companies and you want a way to predict your future returns. You know that Walmart got a $14 return for investing $7, Exxon Mobile $26 for investing $13, and the same for hundreds. Can you predict what your investment will return?

Return(Y) and Investment(X)

Given that you want to invest $15, how can the experience of previous companies help you? Is there a way to capture a relationship between investment and return using data?

The most common tool used in this situation is linear regression. We try to find a line that gets as close as possible to all the points in the plot. Desmos has linear regression built on it. Here is a link to the example.

Linear Regression in Desmos

We fit the line to the points and find a way to predict our return. Looks like we are going to do great. The red dot is pretty high up there, only under Lenovo. You get excited and decide to invest your $15 in Facebook advertising. After a couple of weeks, you see your return and get $6 dollars. What could explain such a disastrous performance? You used math, you tried to learn from previous experiences, and still failed.

“Marketing investments are not straight forward. The way companies spend on advertising and their returns are certainly non-linear”

At least it is not the end of the world, you only lost $15. But you still want to understand why it happened. Luckily you have a friend that is running Facebook ads every day. He is a domain expert. You show him the data and he immediately sees the reason you failed. “Creative Fatigue” he says. Apparently, Facebook users get exhausted from a creative and stop clicking on it. You are still spending money but not getting good performance.

Before you decide that math is a hoax we need to look at the data again. Capturing the data with a linear model was not the right way to go. Let's go back to Desmos, now that we know about creative exhaustion. Looks like there is a penalty for investing too much. Maybe the reason why Ford is under Exxon Mobile is not random.

We can’t use a linear model. We need a non-linear way of fitting the data. That is what Machine Learning in all about. Curve fitting. For more detailed work on how curve fitting works. Link, link, and link.

We need a tool that can fit the always-changing decisions of the market. That’s where neural networks can come into play. You can click on the following 3 interactive visualisations to learn more about how neural networks work.

Visually Explained

One Neuron

In its simplest form, a neural net can only describe linear relationships. One neuron doesn’t get you that far.

Click Here: Link

Three Neurons

Three neurons are able to closely fit our non-linear problem. There is some error but its less than the linear model. You can move the different values and see what type of relationships you can describe.

Click Here: Link

Six Neurons

We can pretty much fit an arbitrary relationship with six neurons.

Click Here: Link

As a final reflexion, neural networks can capture arbitrarily weird relationships. You only need the data and the output is a well-defined function. A lot of questions follow. How can we start doing inference instead of prediction? How do we avoid overfitting? How can we extract a human interpretable relationship from a neural network? This gets increasingly more complicated when you are looking at 3 or thousands of input variables. How can we interpret a relationship with thousands of variables? A lot of people are working on these problems and there are exciting results. More information here, here, here, and here.

Recurrent Neural Chat Boats is where it’s at.

--

--