Machine Learning Tutorial Python - 2: Linear Regression Single Variable

preview_player
Показать описание
In this tutorial we will predict home prices using linear regression. We use training data that has home areas in square feet and corresponding prices and train a linear regression model using sklearn linear regression class. Later on predict method is used on linear regression object to make actual forecast.

#MachineLearning #PythonMachineLearning #MachineLearningTutorial #Python #PythonTutorial #PythonTraining #MachineLearningCource #LinearRegression #sklearntutorials #scikitlearntutorials

Topics that are covered in this Machine Learning Video:
0:00 Simple linear regression
1:59 Linear equation
2:22 Import data in dataframe
2:43 Import sklearn library
3:52 Plot scatter plot
5:26 Create Linear Regression object
13:35 Exercise at the end to predict canada's per capita income

Topic Highlights:
1) What is linear regression
2) Mean squared error
3) Predict home prices by minimizing mean squared error (or MSE)
4) Exercise at the end to predict canada's per capita income

Next Video:

Populor Playlist:

Tools and Libraries:
Scikit learn tutorials
Sklearn tutorials
Machine learning with scikit learn tutorials
Machine learning with sklearn tutorials

#️⃣ Social Media #️⃣
Рекомендации по теме
Комментарии
Автор

Great video 👏
Answer to the given assignment: reg.predict([[2020]])
Output: array([41288.69409442])

Since I am working on it in 2021, I found for that as well using reg.predict([[2021]])
Output: array([42117.15916964])

AdityaThakurXD
Автор

Correction: at 6:53, use reg.predict([[3300]]) instead of reg.predict(3300) as api specification has changed.

A reminder to all

randomstuffs
Автор

after training your dataset
while running object.predict(value), if it gives error, try object.predict( [ [value] ] )
use those two angular brackets

atifalikhan
Автор

I have read and watch a lot of article & video on Google and YouTube, every one explained what is machine learning, ML Types,
their algorithms and blah blah.. but actually no one explained how to do it. this is a great channel I found very very useful where everything is explained in very simple way. Thank you very much

vikasbansode
Автор

The first beneficial lesson that i've ever learned until now about linear regression

majddabour
Автор

Another great lesson presented in an excellent manner. You are becoming the Khan Academy of Computer Science.

FoamyDave
Автор

I have been learning ML for 2 months now from various sources . This is by far the best explanation i have come across.
Thanks for the explanation sir.

shubhamkanwal
Автор

Others were teaching what is linear regression, but everyone failed to teach how to implement with real example. I'm so happy that I found this Love from India <3

gokkulkumarvd
Автор

Thank you very much for opening the door to what looks like a daunting task of hands-on machine learning. You made it so easy and refined. Kudos!

atulbhardwaj
Автор

finally i got a perfect teacher for ML...Thank you sir!

manishyadav
Автор

The best tutorial on Machine Learning on Youtube so far! Thank you!

irmscher
Автор

Thanks for the tutorial!! just a small feedback -- You may want to discuss functions and its parameters --- the fit(X, y) and predict(X)

pankeshpatel
Автор

This I think is the simplest, yet useful explanation of linear regression, coupled with a code demonstration. I’ve had a hard time checking various resources to understand what this algorithm means in simplest terms, and I never had the luck.

Man, somehow you nailed it so well. Keep rocking!!

Looking to explore more topics.

ramkotha
Автор

im so lucky to have found your channel, u have a talent for teaching!!!! i'm watching literally all ur vids and subscribing this channel gonna blow up. GOD SPEED <3<3

am
Автор

Here is the code the works without errors:

X = df["area"].values.reshape(-1, 1) #reshape() transforms the 1D array into a 2D array; if you were selecting more than 1 column you would not need this reshaping.
y = df["price"]

linregr_model = LinearRegression()
linregr_model.fit(X, y)

new_y = 3300
y_pred =

IgorKozarchuk
Автор

Dont know how to thank you for clearing all my doubts...you have opened a big fat doorway for me...please keep up the good work !!!

people_chronicles
Автор

this is what i've been searching for... very clear and to the point explanation! thanks for the lesson.

djie
Автор

I prayed for a channel that would make my learning a lot easier, and I found your channel. Thank you. You sir are awesome.

jakeihekona
Автор

Finally this video made me clear and to convert from Octave to python. And, I did some experiments on data set by stanford university from where i learned ML and it worked. Thanks you so much. And, You are doing such an wonderful job making a lot of stuffs clear. I hope my comment will convey you

bhaswanthreddy
Автор

Assignment done. model.predict([[2020]]) = 41027 . Since I am doing this assignment in 2024, the ans for it is model.predict([[2024]]) = 44288. Thank you sir for the video😊😊

anitoons