Skip to content

A simple demonstration of gradient-descent algorithm in C++ on a linear funciton.

License

Notifications You must be signed in to change notification settings

tanvirtin/gradient-descent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gradient Gradient

A simple classification using linear regression via the gradient descent algorithm.

linear_regression_gradient

Figure-1:

The two differential equations above in Figure-1 is the partial derivation of the cost function with respect to the gradient of the line m, and the the constant b of the line. These equations are fundamental in gradient descent as the rate of change of the cost function with respect to both m and b allows us to plot the line that best fits through our data points.

without-linear-line

Figure-2:

The graph diagram above in Figure-2 shows the plots of the x and y values from the data.csv file. Our goal is to find the line of best fit using gradient descent, a line that can go straight through the curve which would find a relationship between the x and the y values.

with-linear-line

Figure-3:

The graph diagram above in Figure-3 shows a linear line going through the data points, showing us what we want to achieve!