## Linear Regression in 2 Minutes using Python – Scikit Learn – Machine Learning Basics

Linear Regression is one of the simplest machine learning methods. In this video I explain how you can implement this easily using the scikit-learn library in Python.

Written version of this tutorial:
https://towardsdatascience.com/linear-regression-in-6-lines-of-python-5e1d0cd05b8d

GitHub link for notebook and dataset:
https://github.com/chasinginfinity/ml-from-scratch

If you would like to learn more about Linear Regression check out these links:
https://towardsdatascience.com/linear-regression-using-least-squares-a4c3456e8570

Having trouble ? Need help ? Connect with me !

#machinelearning #datascience #regression

Source

### Comment List

December 5, 2020

data.iloc doesn't that give you rows?

December 5, 2020

hi sir what to do when x and y size are not same while plotting the data..its showing a value error

December 5, 2020

Your tutorials are really easy to understand. ..

December 5, 2020

What more do I need to do if I have datetime objects on the X axis?

December 5, 2020

mine doesn't work without a file path to the excel sheet

December 5, 2020

no se entiende un pito!!! pinche acento de la viga

December 5, 2020

Really Nice , Please Keep Making Them With Respect To Machine Learning

December 5, 2020

pls make another analysis, with real life data to solve real life problems.

December 5, 2020

how to set slop(m) and c value and make line bro

December 5, 2020

Excellent video, thank you!

December 5, 2020

I don't quite get what's the meaning of ".reshape[-1,1]"? Would you mind explaining for a bit more?
And for "lr.fit", what does it do behind the scene? Thanks a lot