Skip to content

code-square-labs/SupervisedLearning

Repository files navigation

Supervised Learning

It is the machine learning task of learning a function that maps an input to an output based on example input-output pairs.

I am using boston housing data sets, which is provided by scikit-learn

Linear Regression

The linear regression algorithm is one of the fundamental supervised machine-learning algorithms

Formula: y = a*x + b.

y is the dependent variable (that's the variable that goes on the y axis)

x is the independent variable (i.e. it is plotted on the x axis)

b is the slope of the line

a is the y-intercept

Out put of boston-housing.py:

Manually Loss-Function (a = 15.; b = -70.) Linear Regression

Ordinary Least Squares

Lets use OLS for estimating the unknown parameters a and b

Out put of ordinary-least-square.py:

Estimated Loss Function Estimated Loss Function

Stochastic Gradient Descent

Another algorithm for estimating the unknown parameters a and b

Out put of stochastic-gradient-descent.py:

Estimated Loss Function via Stochastic Gradient Descent Estimated Loss Function

About

Supervised learning with Linear Regression

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages