There are two mistakes people make when building predictive models.
Most models are either too simple to be useful or too complicated to be used. Learning to pick just the right one is a valuable skill that can be applied anywhere.
Here is the basic principle behind it. ↓
Let's see some movie review sentiment analysis to illustrate the point!
Here is a short review snippet: "I had the terrible misfortune of having to view this b-movie in its entirety."
Without a doubt, this review is negative.
Based on this sample, one possible way to capture the sentiment could be just simply looking for the word "horrible".
Reviews containing it are predicted as negative. Otherwise, they are positive.
Now take a look at this review.
"It was fun to watch. But yea, definitely not a bad/horrible movie."
Our model predicts this as negative, despite being a positive review.
What happened? The model failed to capture contextual information, leaving us with false predictions.
Now, let's look at the opposite end of the spectrum.
With its 175 billion parameters, the GPT-3 model surely has the capacity to capture the relation between text and its sentiment.
However, would that be feasible? Not really.
GPT-3 is so huge that its training costs millions of USD, takes weeks, and even the parameters are stored in several distinct computers.
Using a large model for prediction is difficult as well. It may run on servers, but definitely not, for example, on a mobile phone.
Thus, a hyper-accurate and complex model can fail just as much as an oversimplified one, but in a different way.
We need to pick one that is complex enough to be accurate, but simple enough to be useful.
This zone in the middle, is called the Goldilocks zone.
If you would like to visualize this, here is an excellent illustration and explanation.
The term "Goldilocks zone" comes from the children's story The Three Bears, where a young girl named Goldilocks has to pick between three different bowls of food.
She chooses the one that is not too hot or not too cold, but just the right temperature.
This principle is so universal that our world is full with its applications.
For instance, in astrobiology, the habitable zone around a star is called the Goldilocks zone.
To sum up, always include the necessary variables in your model, but not more. This applies to other areas of life: going all the way can be too much, but putting at least some energy is required.
Just like sports. I am not an athlete, yet I do sports every day for my health.
• • •
Missing some Tweet in this thread? You can try to
force a refresh
Differentiation reveals much more than the slope of the tangent plane.
We like to think about it that way, but from a different angle, differentiation is the same as an approximation with a linear function. This allows us to greatly generalize the concept.
Let's see why! ↓
By definition, the derivative of a function at the point 𝑎 is defined by the limit of the difference quotient, representing the rate of change.
In geometric terms, the differential quotient represents the slope of the line between two points of the function's graph.
There is more than one way to think about matrix multiplication.
By definition, it is not easy to understand. However, there are multiple ways of looking at it, each one revealing invaluable insights.
Let's take a look at them!
↓ A thread. ↓
First, let's unravel the definition and visualize what happens.
For instance, the element in the 2nd row and 1st column of the product matrix is created from the 2nd row of the left and 1st column of the right matrices by summing their elementwise product.
To move beyond the definition, let's introduce some notations.
A matrix is built from rows and vectors. These can be viewed as individual vectors.
You can think of them as a horizontal stack of column vectors or a vertical stack of row vectors.
One common wisdom about gambling is that the house always wins.
This is not just a catchphrase; there is mathematical evidence behind it. If you play against an opponent with much deeper pockets, your chances of winning approach zero.
Read on to see why.
↓ A thread. ↓
To illustrate the problem above, consider a simple example: betting on coin tosses.
The dealer tosses a fair coin. If it lands on heads, you win $1. If tails, you lose $1.
You have 𝑛 dollars, while the casino has 𝑚. In total, there are 𝑁 = 𝑛 + 𝑚 dollars on the table.
You win when you reach 𝑁 dollars. However, if you get to zero, you lose.
The question is simple: what is the probability of winning?
There are 25 people in a room. What is the probability that two of them share the same birthday?
If you think it is low, you'll be surprised to find out that the actual probability is more than 50%.
Here is why!
↓ A thread. ↓
The usual thinking is if there are 25 people and 365 days in a year, then chances should be roughly 24/365 ≈ 6.5%, and if we have 366 people, then it is guaranteed that two of them share birthdays.
However, this is not how probability works.
First, it is much easier to talk about the probability of having no shared birthdays.
This is a common trick, often making the calculations much more manageable.