Santiago Profile picture
Mar 9, 2021 16 tweets 5 min read Read on X
Here is an underrated machine learning technique that will give you important information about your data and model.

Let's talk about learning curves.

Grab your ☕️ and let's do this thing!

🧵👇
Start by creating a model. Something simple. You are still exploring what works and what doesn't, so don't get fancy yet.
We are now going to plot the loss (model error) vs. the training dataset size. This will help us answer the following questions:

▫️ Do we need more data?
▫️ Do we have a bias problem?
▫️ Do we have a variance problem?
▫️ What's the ideal picture?
▫️ Do we need more data?

As you increase the training size, if both curves converge towards each other and stop improving, you don't need more data.

If there's room for them to continue closing the gap, then more data should help. Image
This one should be self-explanatory: if our errors stopped improving after adding more data, it's unlikely that more of it will do any good.

But if we still see the loss improving, more data should help push it even lower.
▫️ Do we have a bias problem?

If the training error is too high, we have a high bias problem.

Also, if the validation error is too high, we have a problem with the bias —either low or high bias. Image
A high bias indicates that our model is not powerful enough to learn the data. This is why our training error is high.

If the training error is low, that's a good thing: our model can fit the data.
High validation error indicates that our model is not performing well on the validation data. We probably have a bias problem.

To know in which direction, we need to look at the training error to decide.

▫️ Low training error: low bias
▫️ High training error: high bias
▫️ Do we have a variance problem?

If there's a big gap between the training error and the validation error, we have high variance.

A low training error also indicates that we have high variance. Image
High variance indicates that the model fits the data too well (probably memorizing it.)

When testing with the validation set, we should see the big gap indicating that the model did great with the training set, but sucked with the validation set.
A couple more important points:

▫️ High bias + low variance: we are underfitting.
▫️ High variance + low bias: we are overfitting.
▫️ What's the ideal picture?

These are the curves that you should be looking forward to getting.

Training and validation error converged both to a low error. Image
Here is another chart that does an excellent job at explaining bias and variance.

You want low bias + low variance, but keep in mind there's always a tradeoff between them: you need to find a good enough balance for your specific use case. Image
If these threads help, then make sure to follow me, and you won't be disappointed.

And for even more in-depth machine learning stories, make sure you head over digest.underfitted.io. The first issue coming this Friday!

🐍 Image
Here is a quick guide that will help you dealing with overfitting and underfitting:



Both error or score will work to create good learning curves.

They will simply work as opposites: You always want to maximize score and minimize error.

• • •

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

Keep Current with Santiago

Santiago 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 @svpino

Apr 30
Improve your LLM-based applications by 200%:

Build an LLM-as-a-Judge evaluator and integrate it with your system.

This sounds harder than it is.

Here is how to do it and the things you need to keep in mind:

1/11 Image
(LLM-as-a-judge is one of the topics I teach in my cohort. The next iteration starts next week. You can join at .)

LLM-as-a-Judge is a technique that uses an LLM to evaluate the quality of the outputs from your application.

2/11ml.school
There are three specific scenarios you can test with a judge:

1. Choose the best of 2 answers (pairwise comparison)

2. Assess specific qualities of an answer (reference-free)

3. Evaluate the answer based on additional context (reference-based)

3/11 Image
Read 11 tweets
Apr 18
Falling off ladders to claim insurance checks is a multi-million-dollar fraud business in the US.

People bury insurance companies in paperwork to steal from them.

Enter RAG.

Here is how RAG is becoming the cheaters' worst nightmare (and how you can do the same):

1/8 Image
An insurance claim can easily have 20,000 pages, and somebody must read them all!

I work with @EyeLevel, and we built a fraud detection system using their GroundX platform.

Best RAG use case I've seen—and you can use GroundX to build your own in any vertical.

2/8
Here is how you stop the cheaters:

First, the application ingests all of the documentation. All 20,000+ pages go into the database.

GroundX uses a pretrained vision model to ingest and understand documents, which is especially good for complex documents.

3/8
Read 8 tweets
Mar 7
Here is an explanation of what MCP is, how it works, and why I think it's awesome.

I will also show you the MCP server I'm building.

This is good stuff.
For those who like YouTube better:



By the way, I won't like you anymore if you don't subscribe to my channel.
Here is where I'd start reading to understand what MCP is and what it does:



After you read "Core architecture", jump around all the other concepts. They will give you an idea of everything you can do with MCP. modelcontextprotocol.io/docs/concepts/…Image
Read 4 tweets
Jan 16
AWS is irrefutable proof that the right software with a great backend can succeed despite horrible UI/UX.
Craigslist: “hold my beer”
eBay: “Did anyone said ‘horrible UI’?”
Read 11 tweets
Nov 12, 2024
This is worth 1,000+ hours of engineering work every year:

1. Reproducing a bug
2. Getting detailed debug data
3. Writing how to reproduce it
4. Putting it all together in a good bug report

This tool can do all of this and cut the time it takes to fix the bug by 70%+:
makes the reporting and fixing process really fast!

Click once, and engineers get:

• Console logs
• Network requests
• Timing waterfall
• Repro steps
• Session & user details
• Device & OS
• Backend logs

Check the attached video. Jam.dev
It's just a browser extension - so anyone can report bugs w/ technical details.

Even after the bug just happened!

You can click instant replay, and Jam will create a detailed report with real-time data and video up to the last 2 minutes.
Read 4 tweets
Oct 1, 2024
My new soon-to-be Linux laptop right before I start assembling it. Image
RAM and SSD are now installed. Took me 1 minute and I didn’t even read the manual. Image
The packaging is very nice. A lot of cardboard. This thing comes well protected.

Mostly, frustration-free packaging. Reminiscent of Apple’s boxes. Image
Read 13 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!

:(