Vladimir Haltakov Profile picture
Feb 24 โ€ข 11 tweets โ€ข 4 min read
Is your machine learning model performing well? What about in 6 months? ๐Ÿค”

If you are wondering why I'm asking this, you need to learn about ๐—ฐ๐—ผ๐—ป๐—ฐ๐—ฒ๐—ฝ๐˜ ๐—ฑ๐—ฟ๐—ถ๐—ณ๐˜ and ๐—ฑ๐—ฎ๐˜๐—ฎ ๐—ฑ๐—ฟ๐—ถ๐—ณ๐˜.

Let me explain this to you using two real world examples.

Thread ๐Ÿ‘‡
Imagine you are developing a model for a self-driving car to detect other vehicles at night.

Well, this is not too difficult, since vehicles have two red tail lights and it is easy to get a lot of data. You model works great!

But then... ๐Ÿ‘‡ Image
Car companies decide to experiment with red horizontal bars instead of two individual lights.

Now your model fails to detect these cars because it has never seen this kind of tail light.

Your model is suffering from ๐—ฐ๐—ผ๐—ป๐—ฐ๐—ฒ๐—ฝ๐˜ ๐—ฑ๐—ฟ๐—ถ๐—ณ๐˜

๐Ÿ‘‡ ImageImage
Concept drift happens when the objects you are trying to model change over time.

In the case above, cars changed and you now need to adapt your model.

Another example ๐Ÿ‘‡
You are now dealing with the detection of traffic sights. Again, at night things are pretty easy because signs reflect the lights from the car's headlights and are very well visible in the image. Easy!

And again something happens... ๐Ÿ‘‡ Image
New cars start getting more powerful laser high beams and now suddenly the signs reflect so much light that there are overexposed in the image.

The problem now is ๐—ฑ๐—ฎ๐˜๐—ฎ ๐—ฑ๐—ฟ๐—ถ๐—ณ๐˜.

๐Ÿ‘‡ Image
Data drift happens when the object you are modeling stays the same, but the environment changes in a way that affects how the object is perceived.

In this case, the signs are exactly the same, but they appear different because of the lighting.

๐Ÿ‘‡
Since we talked about Sampling Bias last week, we can connect it with the concept of drift. Since the underlying distribution of your data changed, even if your sampling was good in the beginning it isn't anymore

You now have a Sampling Bias problem



๐Ÿ‘‡
What can we do about it?

While there are some methods like online learning to continue improving the model and some others to detect the drift, usually the solution is just to retrain your model.

This is something you need to be prepared about in your pipeline!

๐Ÿ‘‡
Follow me @haltakov for more intuitive explanations of machine learning and web 3 topics.
This depends on your application and how much error you can tolerate. You first need to monitor the model and detect that it is getting worse. Then collect data and retrain.

You can also keep the data collection ongoing and retrain periodically.

โ€ข โ€ข โ€ข

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

Keep Current with Vladimir Haltakov

Vladimir Haltakov 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 25
There are two problems with ROC curves

โŒ They don't work for imbalanced datasets
โŒ They don't work for object detection problems

So what do we do to evaluate our machine learning models properly in these cases?

We use a Precision-Recall curve.

Thread ๐Ÿ‘‡

#RepostFriday Image
Last week I wrote another detailed thread on ROC curves. I recommend that you read it first if you don't know what they are.



Then go on ๐Ÿ‘‡
โŒ Problem 1 - Imbalanced Data

ROC curves measure the True Positive Rate (also known as Accuracy). So, if you have an imbalanced dataset, the ROC curve will not tell you if your classifier completely ignores the underrepresented class.

Let's take an example confusion matrix ๐Ÿ‘‡ Image
Read 20 tweets
Feb 22
Math is not very important when you are using a machine learning method to solve your problem.

Everybody that disagrees, should study the 92-page appendix of the Self-normalizing networks (SNN) paper, before using
torch.nn.SELU.

And the core idea of SNN is actually simple ๐Ÿ‘‡ ImageImageImageImage
SNNs use an activation function called Scaled Exponential Linear Unit (SELU) that is pretty simple to define.

It has the advantage that the activations converge to zero mean and unit variance, which allows training of deeper networks and employing strong regularization.

๐Ÿ‘‡ ImageImage
There are implementations both in PyTorch (torch.nn.SELU) and TensorFlow (tf.keras.activations.selu).

You need to be careful to use the correct initialization function and dropout, but this is well documented.

The code is open-source as well: github.com/bioinf-jku/SNNs

๐Ÿ‘‡
Read 9 tweets
Feb 21
This is like an NFT in the physical world

This is a special edition BMW 8 series painted by the famous artist Jeff Koons. A limited-edition of 99 with a price of $350K - about $200K more than the regular M850i.

If you think about it, you'll see many similarities with NFTs

๐Ÿ‘‡ Image
Artificially scarce

BMW can surely produce (mint ๐Ÿ˜…) more than 99 cars with this paint. The collection size is limited artificially in order to make it more exclusive.

Same as most NFT collections - they create artificial scarcity.

๐Ÿ‘‡
Its price comes from the story

The $200K premium for the "paint" is purely motivated by the story around this car - it is exclusive, it is created by a famous artist, it is a BMW Art Car.

It is not faster, more reliable, or more economic. You are paying for the story.

๐Ÿ‘‡
Read 10 tweets
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
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
Feb 17
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 ๐Ÿ‘‡
Read 12 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

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 on Twitter!

:(