Which one do you prefer? The code on the left, or the code on the right?

I'd love to hear why. ImageImage
I always was a “left” kind of programmer.

For quite some time now I’ve been forcing myself to use the right style.

Look at “EAFP vs LBYL”. Pretty interesting arguments.

- LBYL - Look Before You Leap. (Left)

- EAFP - Easier to Ask for Forgiveness than Permission. (Right)
Also, I love all of you, but it’s usually a good practice to answer the question using one of the two options instead of going with a third, imaginary option that you feel is better for your imaginary problem.

😋
The best part of this thread is the people that come accusing others of "bad practices" or "it's either my way or the highway."

You gotta love this community.
The world is not binary.

There are good practices in Java that don't apply in JavaScript. There are C++ patterns that shouldn't be followed in Python.

• • •

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

8 Oct
I get asked about machine learning all the time.

Here are my answers to some of these questions: ↓
Q: Where do I start?

Start by learning how to program.

Take your time. Usually, a solid year of Python experience will set you up for success.

Kaggle has a great introductory tutorial to get you started with Python.
Q: I already have plenty of Python experience. Now what?

For most people, I recommend the "Machine Learning Crash Course" created by Google or the "Intro to Machine Learning" from Kaggle.

If you are feeling adventurous, take "Machine Learning" from @AndrewYNg on Coursera.
Read 13 tweets
7 Oct
More data is usually not the way to turn around a mediocre machine learning model.

I've heard too many times that deep learning's silver bullet is throwing more data at a problem.

That hasn't been my experience.

Good Data is better than Big Data.
More data, even with a moderate amount of mislabeled examples, will hurt your model.
Assuming the data is good, then more data is probably not going to be a problem.

Unfortunately, the quality of data is usually inversely proportional to the amount of it. More data is often mediocre data.

But if your data is good, no harm.
Read 4 tweets
1 Oct
A team led by MIT examined 10 of the most-cited datasets used to test machine learning systems.

They found that around 3.4% of the data was inaccurate or mislabeled.

Those are very popular datasets. How about yours?

I've worked with many datasets for image classification.

Unfortunately, mislabeled data is a common problem.

It is hard for people to consistently label visual concepts, especially when the answer is not apparent.
This is a big problem.

Basically, we are evaluating models with images of elephants, expecting them to get classified as "lions."

Your model can't perform well this way.
Read 12 tweets
30 Sep
Do you want more people to read your Twitter threads?

Here is something you can do.

I'm glad threads have become popular, and more people are publishing their content that way.

I've been experimenting with threads for a while. I've learned a ton of what works and what doesn't.

Keep in mind that this advice is based on my experience. It may not work for you.
The advice is simple: Don't scare the reader on your first tweet.

If you announce that your thread is "huge" or that it is a "mega-thread," people will tend to shy away from it.

The same happens if you start your thread with something like "1/25."

25 tweets???!!!
Read 12 tweets
29 Sep
Here is a fantastic example of dimensionality reduction.

Look at the attached images. They both show the number zero (huge pixels, but convince yourself they are zeros.)

The one on your left requires 64 dimensions. The one on your right only needs 5 dimensions!
We are cutting 92% of the dimensions but still keeping the essence of the data.

Dimensionality reduction is a key technique you should study.

This example uses singular value decomposition.

A couple more:

• Principal component analysis
• Independent component analysis
In case you are curious, here is the process to go from the first image (the one with 64 dimensions) to the second image:

1. Take the image
2. Apply singular value decomposition
3. Use top 5 resultant dimensions

I used this example from a course that I'm going through.
Read 8 tweets
28 Sep
"You can't use an algorithm unless you understand how it works."

That's what many people say. But I don't believe it.

This is how you can build expertise: ↓
We all learn new things in different ways.

Personally, I'm a huge proponent of learning on-demand:

• Start with a problem
• Try to solve it
• Incorporate new knowledge as you go
Almost every time:

I start using new techniques with a very superficial understanding of how they work.

Sometimes, I only know they *do* work but have no idea how.
Read 14 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 Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(