Skip to content

DrIanGregory/MachineLearning-MultiLinearRegressionWithGradientDescent

Repository files navigation

MachineLearning-MultiLinearRegressionWithGradientDescent

Description:

  • Python script to estimate coefficients for multilinear regression using gradient descent algorithm.
  • Linear regression implemented from scratch.
  • Using simulated data of job prospects given AI and machine learning skills.

Cost of algorithm improvement through epochs. Shape of the hyperplane as cost from algorithm improves through epochs.

Where:
y is the target,

is the intercept (bias value)

W is a vector of parameter (weights) to be estimated.

X is a matrix of 1's and K feature weights and N data points of given inputs

and is a vector of estimation errors denoted

  • The loss function chosen is minimum mean square error given by:

  • With partial derivatives

  • With weight updates given by:

  • Where is the "learning weight".

How to use

python mulitpleLinearRegression.py

Expected Output

=======================================================================
MULTI LINEAR REGRESSION USING GRADIENT DESCENT TERMINATION RESULTS
=======================================================================
Initial Weights were:             0.0, 0.0, 0.0.
   With initial cost:          3281.9.
        # Iterations:       2,500,000.
       Final weights:    w0:+24.94, w1:+0.32, w2:+0.483.
          Final cost:            +8.1.
                RMSE:            +4.0, R-Squared:         +0.7
=======================================================================
Finished

Requirements

Python (>2.7), Numpy and Pandas.

Releases

No releases published

Packages

No packages published

Languages