It sucks if your ML model can't achieve good performance, but it is even worse if you don't know it!

Sometimes you follow all the best practices and your experiments show your model performing very well, but it fails when deployed.

A thread about Sampling Bias 👇
There is a lot of information about rules you need to follow when evaluating your machine learning model:

▪️ Balance your dataset
▪️ Use the right metric
▪️ Use high-quality labels
▪️ Split your training and test data
▪️ Perform cross-validation

But this may not be enough 👇
A common problem when evaluating an ML model is the Sampling Bias.

This means that your dataset contains more samples of some part of the underlying distribution than others.

Some examples 👇
You are training a computer vision model for traffic light detection.

You have many samples of vertical traffic lights, but you don't include any horizontal traffic lights.

👇
You are training a natural language processing model.

You have samples from many people, but you have no samples from a particular language dialect.

👇
You are training a model to predict housing prices.

You have data from the market for the last 10 years, but you don't have any data after the COVID-19 pandemic started.

👇
What is the problem?

The biggest problem is that you usually don't know you have a problem while evaluating your model.

Your data is correctly split for training and testing, but neither dataset contains the problematic examples.

👇
This means that you will be able to reach high accuracy on your test dataset and even on cross-validation.

However, when you encounter the underrepresented or missing samples in production, your model will fail.

So, what can we do about that? 👇
Know your domain

You need to know your domain very well. You need to understand where the data is coming from, how is it collected, what variations exist in the underlying distribution.

You need to think of ways how to get samples covering all cases.

👇
Be prepared to detect problems in the production

Even with the best preparation, there will be cases you didn't think about. Accept that!

Make sure you have good monitoring of your model to detect when it fails and inspect these cases.

👇
Be prepared to retrain your model

You need to be prepared to iterate. Make sure you can collect additional data from the problematic situations, retrain your model and deploy again.
If you liked this thread you will also like the other things I post too. I regularly tweet about similar topics.

Follow me @haltakov for more!

• • •

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

Keep Current with haltakov.eth | (🤖,🧠)

haltakov.eth | (🤖,🧠) 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 @haltakov

Feb 18
Did you ever want to learn how to read ROC curves? 📈🤔

This is something you will encounter a lot when analyzing the performance of machine learning models.

Let me help you understand them 👇

#RepostFriday Image
What does ROC mean?

ROC stands for Receiver Operating Characteristic but just forget about it. This is a military term from the 1940s and doesn't make much sense today.

Think about these curves as True Positive Rate vs. False Positive Rate plots.

Now, let's dive in 👇
The ROC curve visualizes the trade-offs that a binary classifier makes between True Positives and False Positives.

This may sound too abstract for you so let's look at an example. After that, I encourage you to come back and read the previous sentence again!

Now the example 👇
Read 19 tweets
Jan 18
The Internet is already decentralized, why do we need web3? 🤔

This is a common critique of web3. However, decentralization on its own is not always enough - sometimes we need to agree on a set of facts.

Blockchains give us a consensus mechanism for that!

Thread 🧵

1/12
The Internet is built of servers that communicate using open protocols like HTTP, SMTP, WebRTC etc. Everybody can set up a server and participate. It is decentralized!

However, if two servers distribute contradicting information, how do you know which one is right?

2/12
This is what blockchains give us, a way for decentralized parties to agree on one set of facts. They offer a consensus mechanism!

Imagine the blockchain as a global public database that anybody can read and nobody can falsify - every transaction/change needs to be signed.

3/12
Read 15 tweets
Jan 18
How decentralized is web3 really?

While there is a lot of hype around web3, NFTs, and decentralized apps (dApps), there is also a lot of criticism. Today, I'll focus on the critique that web3 is actually too centralized.

Let's try to have an honest discussion 👇
These are the main arguments I see regularly. Please add more in the comments.

1️⃣ The Internet is already decentralized
2️⃣ It is inefficient
3️⃣ Everything can be implemented better using a centralized approach
4️⃣ Important services are centralized

👇
I was inspired to write this in part after reading this great article by @moxie pointing some of the problems with the current state of web3. If you've been living under a rock in the last weeks, make sure you check it out:

moxie.org/2022/01/07/web…

👇
Read 9 tweets
Jan 17
How many parameters do you need in your neural network to solve any problem? 🤔

GPT-3 has 175 billion, MT-NLG has 530 billion and Wu Dao has 1.75 trillion.

But the truth is you only need 1 parameter. No, not 1 billion. Just a single parameter!

Let me explain 👇
Yes, of course, I'm trolling you, but only a little bit 😁

I want to show you this very cool work by @ranlot75 about how to fit an arbitrary dataset with a single parameter and the following function

github.com/Ranlot/single-…

👇
@ranlot75 Here are examples of some 2D image datasets. You see the parameter alpha and the reconstructed image.

Now, let me give you some high-level intuition how this works 👇
Read 7 tweets
Dec 29, 2021
You think you know what is an NFT? Well, think again...

You are doing it wrong if you think about NFTs as pixelated images of punks, toads, or apes. It is not about the JPEG!

A better mental model for thinking about NFTs 👇
Forget the images for now. Owning an NFT means that your wallet address is listed as the owner of a specific digital asset on the blockchain.

Digital assets are organized in collections and an NFT is one specific piece of this collection.

Let's look at an example 👇
I own an NFT from the @underfittedio membership collection - a membership card.

You can now check the collection on the blockchain and can see that my wallet address is the owner of token ID 4.

Everybody can check this. Nobody can change it - except me!

How is this useful? 👇
Read 26 tweets
Dec 21, 2021
Things are getting more and more interesting for AI-generated images! 🎨

GLIDE is a new model by @OpenAI that can generate images guided by a text prompt. It is based on a diffusion model instead of the more widely used GAN models.

Some details 👇
@OpenAI GLIDE also has the interesting ability to perform inpainting allowing for some interesting usages.

👇
@OpenAI Here is the full paper

arxiv.org/abs/2112.10741

👇
Read 5 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!

:(