Levi Profile picture
Sep 17, 2023 8 tweets 3 min read Read on X
A surprising statistical result 🔽

You have tested positive for a disease.

- The test is 99% accurate.

- 1 out of 10,000 people has the disease.

What is the probability that you truly have the disease, given that you have tested positive?

Let's figure out

🧵 Image
Look at a random group of 1 million people.

Fact 2 says 1 out of 10,000 people has the disease.

In our sample, 100 people have the disease, and 999,900 are healthy. Image
Run the test on the 100 sick people.

Fact 1 says the test is 99% percent accurate.

- 99 people will be diagnosed correctly as sick.

- 1 person will be misdiagnosed as healthy. Image
Now test the 999,900 healthy group.

The test makes 1% mistake.

1% of these 999,900 healthy people are misdiagnosed as sick. Image
Putting it all together:

- the total number of people who tested positive is 99 + 9,999 = 10,098.

- Out of these, only 99 are sick.

Therefore the probability that you have the disease is 99/10,098 = 0.0098

Less than 1%! Image
Why do we have this surprising result?

People tend to focus on fact 1, the 99% accuracy.

But fact 2 is also crucial. 1 out of 10,000 means 0.01%

The 1% is much larger than the 0.01%

In other words, the error rate is larger than the rate of being sick.
That's it for today.

I hope you've found this thread helpful.

Like/Retweet the first tweet below for support and follow @levikul09 for more Data Science threads.

Thanks 😉
If you haven't already, join our newsletter DSBoost.

We share:

• Interviews

• Podcast notes

• Learning resources

• Interesting collections of content

dsboost.dev

• • •

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

Keep Current with Levi

Levi Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

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

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @levikul09

Apr 20, 2024
A surprising statistical result 🔽

You have tested positive for a disease.

- The test is 99% accurate.

- 1 out of 10,000 people has the disease.

What is the probability that you truly have the disease, given that you have tested positive?

Let's figure out

🧵 Image
Look at a random group of 1 million people.

Fact 2 says 1 out of 10,000 people has the disease.

In our sample, 100 people have the disease, and 999,900 are healthy. Image
Run the test on the 100 sick people.

Fact 1 says the test is 99% percent accurate.

- 99 people will be diagnosed correctly as sick.

- 1 person will be misdiagnosed as healthy. Image
Read 7 tweets
Mar 31, 2024
Weights and Biases are the engines in Neural Networks.

I will explain how they work.

🧵 Image
When data is flowing between different neurons or layers, it is not just going from A to B.

Different transformations happen to them.

These transformations are described with Weights and Biases.

Let's discuss each 🔽
1️⃣ Weight

Weights determine how important each factor is in the overall prediction.

This value will determine the influence input data has on the output product.

They work similarly as in weighted means: The input is multiplied by the weights. Image
Read 8 tweets
Mar 24, 2024
Language models need to know how similar texts or words are.

Here is how they do it:
Models usually cannot work with textual data, so we need to convert words into numbers.

This is mostly done with word embeddings. These are vector (numerical) representations of text.
Note: The embeddings are usually huge, but for simplicity now I will use a vector that contains only X and Y coordinates for words.

We have four words in this example: Apple, Banana, Cat and Dog. All of them are converted into vectors and visualized. Image
Read 8 tweets
Mar 20, 2024
5 Regression Algorithms you should know

🧵 Image
1️⃣ Linear

Linear regression is the most fundamental and widely used regression algorithm.

It assumes a linear relationship between the variables.

The goal is to find the best-fitting line that minimizes the errors between the predicted and actual values. Image
2️⃣ Polynomial

Polynomial regression allows for nonlinear relationships between variables.

It adds polynomial functions to the line equation, so it can capture more complex patterns in the data. Image
Read 8 tweets
Mar 17, 2024
10 Pandas 1-liners to start Data Analysis:
1.

This code loads a CSV file into a Pandas DataFrame.

This is usually step 1, so we can start working. Image
2.

This displays the first n rows of the DataFrame, providing a quick snapshot of the data.

Alternative: df.sample

This displays a few rows randomly from the DataFrame. Image
Read 13 tweets
Mar 15, 2024
Perceptron, the simplest Neural Network.

I explain how it works. Image
The Perceptron is a binary classifier.

It can decide if data belongs to A or B or make yes or no decisions.

The two classes are usually represented with 0 and 1. I will use this notation in this thread.
Here are the steps Perceptrons go through:

- It takes several inputs
- Apply weights and biases
- Provides output

If the result is less than or equal to 0, the output is 0.

If the result is higher than 0, the output is 1.

Let's see an example 🔽 Image
Read 9 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(