In this little project I'm going to optimize a cost function (predefined) through the Gradient Descent algorithm
The Gradient Descent is an optimization algorithm that can help us on minimize the cost function of our model.
When we talk about optimization in mathematics, we talk abot finding the critical points of a function.
So in the field of Machine Learning, this algorithm is very useful to improve our model on minimizing the error. We calculate this "error" evaluating our model against real data. This evaluation is known as "cost function".
Once we get the cost function we can optimize it to get the minimum error through the use of the gradient vector (that's why the name of "gradient descent"), that's going to tell us the direction where the function decreases in function of certain parameters.
By doing this we can get or model to get better and better, so this is what we call "to learn" in machine learning. :)
For this project we're going to optimize a cost function that is predefined for practical reasons. The cost function is the next one:
If we plot the function in top view, we can see how we are optimizing the parameters until we reach the local minimum (deep zone in blue).
- Numpy
- SciPy
- Matplotlib
You can see the project working online here
Once you get there click on the "Runtime" option, and then in the "Run all" option and you can see the project working. Go to the last line :)




