Machine Learning Tutorial Python - 4: Gradient Descent and Cost Function

Share this & earn $10
codebasics
Published at : 19 Nov 2021
313937 views
4744
229

In this tutorial, we are covering few important concepts in machine learning such as cost function, gradient descent, learning rate and mean squared error. We will use home price prediction use case to understand gradient descent. After going over math behind these concepts, we will write python code to implement gradient descent for linear regression in python. At the end I’ve an an exercise for you to practice gradient descent

#MachineLearning #PythonMachineLearning #MachineLearningTutorial #Python #PythonTutorial #PythonTraining #MachineLearningCource #CostFunction #GradientDescent

Code: https://github.com/codebasics/py/blob/master/ML/3_gradient_descent/gradient_descent.py
Exercise csv file: https://github.com/codebasics/py/blob/master/ML/3_gradient_descent/Exercise/test_scores.csv

Topics that are covered in this Video:
0:00 Overview
1:23 - What is prediction function? How can we calculate it?
4:00 - Mean squared error (ending time)
4:57 - Gradient descent algorithm and how it works?
11:00 - What is derivative?
12:30 - What is partial derivative?
16:07 - Use of python code to implement gradient descent
27:05 - Exercise is to come up with a linear function for given test results using gradient descent

Topic Highlights:
1) Theory (We will talk about MSE, cost function, global minima)
2) Coding - (Plain python code that finds out a linear equation for given sample data points using gradient descent)
3) Exercise - (Exercise is to come up with a linear function for given test results using gradient descent)

Next Video:
Machine Learning Tutorial Python - 5: Save Model Using Joblib And Pickle: https://www.youtube.com/watch?v=KfnhNlD8WZI&list=PLeo1K3hjS3uvCeTYTeyfe0-rN5r8zn9rw&index=5

Very Simple Explanation Of Neural Network: https://www.youtube.com/watch?v=ER2It2mIagI

Populor Playlist:
Data Science Full Course: https://www.youtube.com/playlist?list=PLeo1K3hjS3us_ELKYSj_Fth2tIEkdKXvV

Data Science Project: https://www.youtube.com/watch?v=rdfbcdP75KI&list=PLeo1K3hjS3uu7clOTtwsp94PcHbzqpAdg

Machine learning tutorials: https://www.youtube.com/watch?v=gmvvaobm7eQ&list=PLeo1K3hjS3uvCeTYTeyfe0-rN5r8zn9rw

Pandas: https://www.youtube.com/watch?v=CmorAWRsCAw&list=PLeo1K3hjS3uuASpe-1LjfG5f14Bnozjwy

matplotlib: https://www.youtube.com/watch?v=qqwf4Vuj8oM&list=PLeo1K3hjS3uu4Lr8_kro2AqaO6CFYgKOl

Python: https://www.youtube.com/watch?v=eykoKxsYtow&list=PLeo1K3hjS3uv5U-Lmlnucd7gqF-3ehIh0&index=1

Jupyter Notebook: https://www.youtube.com/watch?v=q_BzsPxwLOE&list=PLeo1K3hjS3uuZPwzACannnFSn9qHn8to8


To download csv and code for all tutorials: go to https://github.com/codebasics/py, click on a green button to clone or download the entire repository and then go to relevant folder to get access to that specific file.

Website: http://codebasicshub.com/
Facebook: https://www.facebook.com/codebasicshub
Twitter: https://twitter.com/codebasicshub

machine learning gradient descent examplepython gradient descent implementationgradient descent implementation in python

Merely Surviving Isn't Enough

Merely Surviving Isn't Enough

257: What's an "Intensive?"

257: What's an "Intensive?"

Old - Official Trailer [HD]

Old - Official Trailer [HD]

Opening an Establishment Card

Opening an Establishment Card

I Have The Ability To Feel ZERO PAIN!

I Have The Ability To Feel ZERO PAIN!

Volbeat - Our Loved Ones (HD With Lyrics)

Volbeat - Our Loved Ones (HD With Lyrics)

ALexa said a bad word

ALexa said a bad word

Gogo 38-What are you going to do?

Gogo 38-What are you going to do?

Is Brilliant.org Worth The Money For Students? (How to Actually Use It)

Is Brilliant.org Worth The Money For Students? (How to Actually Use It)

Psychic Abilities Everyone Can Unlock

Psychic Abilities Everyone Can Unlock

Rain Radio & DJ Craig Gorman - Talk About (Extended Mix)

Rain Radio & DJ Craig Gorman - Talk About (Extended Mix)

PREFER vs WOULD RATHER (I'D RATHER) in English

PREFER vs WOULD RATHER (I'D RATHER) in English

Greatly Surprised Trailer (Lutheran Renewal Documentary)

Greatly Surprised Trailer (Lutheran Renewal Documentary)

Staff! Job Game - MAX LEVEL HOUSE EVOLUTION!

Staff! Job Game - MAX LEVEL HOUSE EVOLUTION!

Tiempos Pasados | Past Times - Capítulo 2

Tiempos Pasados | Past Times - Capítulo 2

Problematization: What & Why

Problematization: What & Why

TAEMIN 태민 'Advice' MV

TAEMIN 태민 'Advice' MV

What Happens To Your Body When You Start Exercising Regularly

What Happens To Your Body When You Start Exercising Regularly

Hiding In The Blue - RIELL x TheFatRat (LYRICS)

Hiding In The Blue - RIELL x TheFatRat (LYRICS)

Commercial Law - Introduction to Agency

Commercial Law - Introduction to Agency

SINGAPORE: Research team successfully reverses symptoms of potentially fatal heart disorder

SINGAPORE: Research team successfully reverses symptoms of potentially fatal heart disorder

CALENDARIO DELL'AVVENTO CATRICE DIY 2021 🎁

CALENDARIO DELL'AVVENTO CATRICE DIY 2021 🎁

My Friend Needed Help in the most Competitive Tournament EVER..

My Friend Needed Help in the most Competitive Tournament EVER..

James Blake - Famous Last Words (Official Audio)

James Blake - Famous Last Words (Official Audio)

$hirak - Done Done ft. Jonna Fraser & Lil Kleine

$hirak - Done Done ft. Jonna Fraser & Lil Kleine

Gasped With Woodworking Skills Craft // How To Build An Outdoor Office From Monolithic Tree Trunks

Gasped With Woodworking Skills Craft // How To Build An Outdoor Office From Monolithic Tree Trunks

f for får 03 dansk

f for får 03 dansk

Roffe Ruff - 17 Nov (med Bubba Flexx)

Roffe Ruff - 17 Nov (med Bubba Flexx)

A Sophisticated Beachside House with a Surprisingly Playful Interior Design (House Tour)

A Sophisticated Beachside House with a Surprisingly Playful Interior Design (House Tour)

[Eng Sub]The amount of money Kanae spent on the stream overlay was astonishing... [Nijisanji/knkn]

[Eng Sub]The amount of money Kanae spent on the stream overlay was astonishing... [Nijisanji/knkn]

Samsung NEXT Spotlight: Swiftly

Samsung NEXT Spotlight: Swiftly

AutoCAD How To Add Attribute To Block

AutoCAD How To Add Attribute To Block

My Way Back Home (remastered) (feat. Jordan Okrend)

My Way Back Home (remastered) (feat. Jordan Okrend)

I MADE A DRUM SAMPLE PACK

I MADE A DRUM SAMPLE PACK

My BIGGEST Learnings From Keeping Off 30kgs For 20 years | 8 INSIGHTS TO ACHIEVE LASTING WEIGHT LOSS

My BIGGEST Learnings From Keeping Off 30kgs For 20 years | 8 INSIGHTS TO ACHIEVE LASTING WEIGHT LOSS

Warren G - Regulate (Official Music Video) ft. Nate Dogg

Warren G - Regulate (Official Music Video) ft. Nate Dogg

TOP 5 THINGS TO BUY AND RESELL (MAKE TONS OF $$)

TOP 5 THINGS TO BUY AND RESELL (MAKE TONS OF $$)

Could Your Tesla car or Tesla bot be liable for murder?! Legal liability and AI Agents

Could Your Tesla car or Tesla bot be liable for murder?! Legal liability and AI Agents

Designer suites with detailing and  descriptions

Designer suites with detailing and descriptions

Jessie Reyez - Figures (Official Video)

Jessie Reyez - Figures (Official Video)

Purposes of the Church | Early Childhood Lesson 3

Purposes of the Church | Early Childhood Lesson 3

♪ The Obligatory Trump Remix

♪ The Obligatory Trump Remix

Jennifer Hudson - And I Am Telling You I'm Not Going

Jennifer Hudson - And I Am Telling You I'm Not Going

Taylor Swift - You Need To Calm Down

Taylor Swift - You Need To Calm Down

Overview: 1-2 Kings

Overview: 1-2 Kings

How One Game Rocked A Community - The Story Behind Hunt Down The Freeman | TRO

How One Game Rocked A Community - The Story Behind Hunt Down The Freeman | TRO

Cramer's lightning round: I think 23andMe can be bought

Cramer's lightning round: I think 23andMe can be bought

How I make 300k per month from 7 income streams at age 21

How I make 300k per month from 7 income streams at age 21

FISHER - Losing It - Live at Coachella 2019 Friday April 12, 2019

FISHER - Losing It - Live at Coachella 2019 Friday April 12, 2019