14 Sep, 10 tweets, 4 min read
You are (probably) wrong about probability.

If I toss a fair coin ten times and it all comes up heads, what is the chance that the 11th toss will also be heads? Many think that it'll be highly unlikely. However, this is incorrect.

Here is why!

In probability theory and statistics, we often study events in the context of other events.

This is captured by conditional probabilities, answering a simple question: "what is the probability of A if we know that B has occurred?".
Without any additional information, the probability that eleven coin tosses result in eleven heads in a row is extremely small.

However, notice that it was not our case. The original question was to find the probability of the 11th toss, given the result of the previous ten.
In fact, none of the previous results influence the current toss.

I could have tossed the coin thousands of times and it all could have came up heads. None of that matters.

Coin tosses are πππππππππππ‘ of each other. So, we have 50% that the 11th toss is heads.
(If we don't know that heads and tails have equal probability, having 11 heads in a row might raise suspicions.

However, that is a topic for another day.)
Mathematically speaking, this is formalized by the concept of independence.

The events π΄ and π΅ are independent if observing π΅ doesn't change the probability of π΄.
However, people often perceive that the frequency of past events influences the future.

If I lose 100 hands of Blackjack in a row, it doesn't mean that I ought to be lucky soon. Hence, this phenomenon is called the Gambler's fallacy.

en.wikipedia.org/wiki/Gambler%2β¦
In fact, long runs of the same outcomes will happen if the sample size is large enough.

You can check that for yourself with Python.

Below, I simulated 1000 independent coin tosses and highlighted the parts with at least ten heads in a row.
We can actually use runs of matching outcomes to determine if a sequence is truly random.

This method is called the WaldβWolfowitz runs test.

en.wikipedia.org/wiki/Wald%E2%8β¦
I frequently post threads like this, diving deep into concepts in machine learning and mathematics.

If you have enjoyed this, make sure to follow me and stay tuned for more!

The theory behind machine learning is beautiful, and I want to show this to you.

β’ β’ β’

Missing some Tweet in this thread? You can try to force a refresh
γ

This Thread may be Removed Anytime!

Twitter may remove this content at anytime! Save it as PDF for later use!

16 Sep
Data similarity has such a simple visual interpretation that it will light all the bulbs in your head.

The mathematical magic tells you that similarity is given by the inner product. Have you thought about why?

This is how elementary geometry explains it all.

Let's start in the beginning!

In machine learning, data is represented by vectors. So, instead of observations and features, we talk about tuples of (real) numbers.
Vectors have two special functions defined on them: their norms and inner products. Norms simply describe their magnitude, while inner products describe
.
.
.
well, a π₯π¨π­ of things.

1 Sep
The early access of my Mathematics of Machine Learning book is launching today!

One chapter per week, we go from basics to the internals of neural networks. We are starting with vector spaces, the scene where machine learning happens.

Here is why they are so important!

π§΅ ππ½
As you probably know, data is represented by vectors.

Data points are just tuples of measurements. In their raw form, they are hardly useful for us. They are just blips in space.
Without operations and transformations, it is difficult to predict class labels or do anything else.

Vector spaces provide a mathematical structure where operations naturally arise.

Instead of a blip, just imagine an arrow pointing to the data point from a fixed origin.
27 Aug
The Mathematics of Machine Learning book early release is launching in September 1st! Exciting times are ahead :)

If you are interested in understanding the mathematics of machine learning, this is the book for you.

In the early access program, I'll release the sections of this book as I write them.

During our time together, my goal is to guide you through the inner workings of machine learning, from high school mathematics to backpropagation.
This is the release calendar for 2021.

Part 1: Linear algebra

1. Vector spaces (September 1st)
2. Normed spaces (September 8th)
3. Inner product spaces (September 15th)
4. Linear transformations (September 22th)
23 Aug
Machine learning is more than function fitting.

Even though most of us are introduced to the subject through this example, fitting functions to a training dataset seemingly doesn't give us any deep insight about the data.

This is what's working behind the scenes!

π§΅ ππ½
Consider a simple example: predicting the value π¦ from the observation π₯; for instance π¦-s are real estate prices based on the square footage π₯.

If you are a visual person, this is how you can imagine such dataset.
The first thing one would do is to fit a linear function π(π₯) = ππ₯ + π on the data.

By looking at the result, we can see that something is not right. Sure, it might capture the mean value for a given observation, but the variance and the noise in the data is not explained.
13 Aug
How to build a good understanding of math for machine learning?

I get this question a lot, so I decided to make a complete roadmap for you. In essence, three fields make this up: calculus, linear algebra, and probability theory.

Let's take a quick look at them!

π§΅ π
1. Linear algebra.

In machine learning, data is represented by vectors. Essentially, training a learning algorithm is finding more descriptive representations of data through a series of transformations.

Linear algebra is the study of vector spaces and their transformations.
Simply speaking, a neural network is just a function mapping the data to a high-level representation.

Linear transformations are the fundamental building blocks of these. Developing a good understanding of them will go a long way, as they are everywhere in machine learning.
12 Aug
How you play determines who you are.

You might be surprised, but I gained a lot from playing games. Board games, video games, all of them. Playing is a free-time activity, but it can teach a lot about life and work.