Santiago Profile picture
1 Dec, 16 tweets, 4 min read
What is machine learning and why you should care about it?

Let me try to convince you: ↓
2. Let's start with a simple programming exercise:

"Write a function that returns 0 if a supplied number is even or 1 if the number is odd."

If you are a developer, I'm sure you know how to write this function.
3. To simplify things, let's represent this function as follows:

y = f(X)

Where:
• X → The input number
• y → The result (0 if even, 1 if odd)
• f → The function that does the work

We can now get to the interesting part.
4. In this example, we know the relationship between the input number (X) and the output (y).

Writing the function that turns X into y is straightforward.

But what happens if that's not the case?
5. What happens if writing the rules to turn X into y is not a simple task?

If we use machine learning we don't need to write the rules; we can learn them!

This is its fundamental advantage.
6. Here are a few examples where the rules to turn X into y aren't obvious:

• Predict tomorrow's temperature.

• Predict a missing word in a sentence.

• Determine whether an image shows a dog or a cat.

Do you see why these are difficult to implement?
7. Imagine we have samples showing the relationship between X and y.

In the exercise where we want to determine if a number is even or odd, the samples could look like these:

• 2 → 0
• 5 → 1
• 8 → 0
• 3 → 1

We call these samples "training data."
8. With machine learning we can process all of that training data and have the algorithm produce the correct rules for us.

Let that sink in for a second.

With machine learning, we can "learn" what the rules are! We show the algorithm some data, and get the rules back!
9. The attached image from @fchollet's book is a good summary of this idea.

In classical programming, we have to write the rules to produce the answers.

In machine learning, we start with data and answers, and the algorithm gives us the rules.
10. Think about how we—humans—learn:

We look at things, learn patterns, and then generalize those ideas whenever we see something similar.

(Of course, this is a coarse representation of how we learn, but it's a good analogy that helps understand the magic of machine learning.)
11. There is one more idea that I want you to keep in mind:

Despite the power of machine learning, there are trade-offs.

The most obvious one: to do a good job at learning the rules, we need a lot of data.

But not only that.
12. Unless the data we show the algorithm perfectly captures the relationship between X and y without any noise, we can only get an approximation of the results.

Let's illustrate this with a small change to our function.
13. Here is a small change to the function:

y = f(X) + e

See that "e"? It's called "irreducible error." This error is because the training data is not perfect.

Now the output "y" is close enough: an approximation of the actual result.
14. Let's wrap up.

Machine learning gives us access to solve problems that would be very hard to solve with classical programming.

When used inappropriately, we may introduce more noise than what it's worth.

But when it works, it's as close to magic as you could imagine.
15. As a takeaway:

Machine learning is a powerful way to approach otherwise intractable problems.

My recommendation is that, as a software developer, you start incorporating machine learning into your bag of tricks.
I post threads like this every week.

Stay tuned as I help you get to the core of practical machine learning.

You can find the rest of my threads here: @svpino.

• • •

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

3 Dec
When I was at school, I designed a banking application that didn't need authentication (for a class project.)

Yeah, I know it sounds crazy, but I've always been obsessed with "invisible" security.

I see one solution that may get us there for the first time. ↓
The thing that has impressed me the most during my experiments with web3:

You open a website, connect your wallet, and you are in.

That's it.

No "sign up," no "username and password," no "check your email for verification."
I use Dashlane (a password manager.) I have 520 passwords, and I'm reusing 149 of them.

Even better: I have 33 "compromised" passwords.

This is ridiculous. Image
Read 6 tweets
29 Nov
One of the things I love about Python: Duck Typing + EAFP.

A short thread that will change the way you write code.

2. The idea behind Duck Typing:

If it looks like a duck, swims like a duck, and quacks like a duck, then it probably is a duck.

In other words: the functionality of an object is more important than its type. If the object quacks, then it's a duck.
3. Duck Typing is possible in dynamic languages.

Look at the attached example.

Notice how "Playground" doesn't care about the specific type of the supplied item. Instead, it assumes that it supports the bounce() function.
Read 11 tweets
22 Nov
For one second, let's forget the idea of a central database.

Imagine a product that doesn't store your data. Instead, you keep that information. You allow others to use it at your convenience and close it whenever you want to.

Let's talk about one example. ↓
2. Think about those people that have built excellent profiles using @kaggle.

They have participated in many competitions, shared their knowledge, and built impressive curriculums.

What would happen if Kaggle decides to ban them?
3. This is not science fiction.

Every single company out there can ban you if they decide to do so.

Maybe it is justified, maybe it isn't, but that's beyond the point.

What happens then?
Read 18 tweets
19 Nov
Deploying a machine learning model is not a trivial task.

Here are some of the questions you may have to answer every time: ↓
1. What's the input format expected by your service?

2. How can we validate the input is valid? What's the appropriate action if it isn't.

3. What transformations are needed to turn the service's input into the model's input?
4. What transformations are needed to turn the model's output into the service's output?

5. Do we need to allow for batch processing of data?

6. How much time do we have to return an answer?
Read 6 tweets
10 Nov
Over the last few months, I've introduced three main improvements to how I build machine learning models.

Keep in mind that my job is focused on Computer Vision, and I mostly use TensorFlow and Keras.

Here are the highlights: ↓
First, I replaced image generators with the tf.data API.

This change alone has had a major impact on training time. But it doesn't stop there:

• My code is much cleaner
• A data pipeline is easily reusable

tf.data is a must.
Together with loading data, I used image generators to perform data augmentation.

Now, I try to make data augmentation part of the model using Keras' preprocessing layers.

These augmentations now happen in the GPU. This is another nice boost!
Read 6 tweets
8 Nov
If I were to start building a career in machine learning today, here is where I'd focus:

1. Python from the get go.
2. Learn how to build software.

I'd take my time here and avoid rushing into the "machine learning" specific stuff.

Something interesting happens here: ↓
A lot of people start learning software development because they want to get into machine learning.

Then they realize that machine learning is not what they care about.

This is great: there are many ways to build a successful career in the software industry.
As soon as you're comfortable, here is what I'd tackle next:

3. Machine learning fundamentals
4. Hands-on machine learning

I like to cover these at the same time, instead of one after the other: learn some theory, then apply it right away.

Something to keep in mind:
Read 12 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

Too expensive? 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!

:(