Levi Profile picture
Dec 8 6 tweets 2 min read Twitter logo Read on Twitter
Gradient descent is a powerful optimization technique.

But it has 3 main types. What are the differences? When to use them?

Let's figure it out! 🧵 Image
The 3 gradient descent types differ in how much data they use in the process.

This will result in a trade-off between accuracy and computation time.

These are really important aspects of an analysis, so using the appropriate gradient descent method is essential.
1️⃣ Batch gradient descent

This method uses the entire dataset to perform an update in the model.

With large data it can be very slow, but if the data is manageable, this method will provide a smooth convergence. Image
2️⃣ Stochastic gradient descent

In SGD one datapoint is used to take one step at a time.

This method can cause the optimization process to be less stable since its noisiness.

But SGD is computationally more efficient. Image
3️⃣ Mini-Batch Gradient Descent

A fixed number of training samples is used here (not only one but not all).

It tries to combine the advantages of the above-mentioned methods.

The only issue with Mini-Batch is that you have an additional parameter, the batch size. Image
That's it for today.

I hope you've found this thread helpful.

Like/Retweet the first tweet below for support and follow @levikul09 for more Data Science threads.

Thanks 😉

• • •

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

Keep Current with Levi

Levi 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 @levikul09

Dec 10
Neural Networks can tackle complex issues with complex calculations.

But today I will make the complex simple for you!

Let's see how Neural Networks work Image
First of all, why do we use Neural Networks?

Sometimes you will face datasets that are too complicated for a simple model like Linear Regression.

Neural Networks however can identify any relationship between the variables. Image
Complexity can be tackled by complexity.

If you face a complex dataset, you can add layers and nodes to make your Neural Network more complex and better fit for the data.

Note: More complex Neural Networks are not always equal better results! Image
Read 8 tweets
Dec 6
Here is Greg Brockman, co-founder of OpenAI, studying machine learning in 2018.

He shares the journey on his blog. It's a gem.

Here are the FREE resources he used. 🧵 Image
CS 294 Deep Reinforcement Learning, Spring 2017

- From supervised learning to decision-making.

- Basic reinforcement learning

rll.berkeley.edu/deeprlcoursesp…
Image
CS231n: Deep Learning for Computer Vision. Stanford

This course is a deep dive into the details of deep learning architectures.

youtube.com/playlist?list=…
Image
Read 7 tweets
Dec 3
How does the Decision Tree model choose the best questions?

Gini impurity index 🧵 Image
We know that for the best result, we need to ask great questions.

How do we know if a question is good?

We do measurements and comparisons.

In the case of Decision Trees we usually use Gini Impurity Index or Gini Index in short.

Let's see how Gini Index works:
Gini Index will tell us how diverse the dataset is.

If a set contains similar elements the set has low Gini Index.

Let's consider two sets:

Set 1: 8 🍎 , 2 🍌

Set 2: 4 🍎 , 3 🍌 , 2 🍉 , 1 🍋

Set 1 seems purer, meaning it has less diversity.
Read 10 tweets
Dec 2
Linear Regression in 5+1 easy steps!

Create a predictive model in Python using scikit-learn.

🧵 Image
1️⃣ Import packages and read the dataset

We will use

- Pandas and NumPy for data manipulation

- Matplotlib for visualization

- Scikit-learn for the model

We want to predict Sales based on money spent on TV advertisements Image
Note:

Two columns: Radio and Newspaper have been dropped.

This way we can focus only on two variables:

- Money spent on TV advertisements

- Sales - our target variable
Read 11 tweets
Nov 30
Errors in Linear regression ⚠️

How do we know if our predictive model is good or bad?

I will explain.

🧵 Image
We have 2 different approaches to measure how good our model is.

1️⃣ Absolute error

2️⃣ Square error

Let's see how they work 👇

1/11
1️⃣ Absolute error

A good Linear Regression model is looking for a line that is close to the points.

The absolute error is the sum of the distances between the data points and the line.

So to find the best line we need to minimize the absolute error.

2/11 Image
Read 13 tweets
Nov 29
Many people can't afford a Data Science degree.

I'm one of them.

Here is a roadmap, so you can learn Data Science from the beginning.
1. Learn to code in Python!

It's the most popular language in Data Science.

But besides the script, focus on the logic too!

With @brilliantorg you can do it the fun way.

They have intro and "Python next steps" courses as well. Check it out here: brilliant.org/LeviPython/
2. Explore data visually

The best way to communicate results is with visuals.

You will need this skill in every project, so build a solid foundation.

Forget fancy charts! Learn how to deliver impactful visuals that tell stories.

Start here: brilliant.org/LeviData/
Read 7 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!

:(