In this repository you can find demo code written in Python and MATLAB for Chapters 2 - 8 from the textbook Machine Learning Refined. You can download this chapter by visiting www.mlrefined.com
Current code demos include:
Below is a video tutorial illustrating how gradient descent works via use of the demo code (convex_grad_surrogate and nonconvex_grad_surrogate, which you may find here) - these illustrate the basic concepts underlying gradient descent applied to minimizing both convex and nonconvex functions. Some principles from the chapter are briefly described before jumping into the code.
Below is a video tutorial illustrating how Newton's method works via use of the demo code (convex_newton_surrogate and nonconvex_newton_surrogate, which you may find here) - these illustrate the basic concepts underlying Newton's method applied to minimizing both convex and nonconvex functions. Some principles from the chapter are briefly described before jumping into the code.
Below is a video tutorial illustrating how L2 regularization convexifies nonconvex cost functions, thereby making minimization of such functions easier. The code (l2reg_logistic, which you may find here) shows the result of applying L2 regularization to a nonconvex form of logistic regression on a simple dataset, as well as the resulting convexificaation of this cost function due to regularization. Again, some principles from the chapter - which is available for download at www.mlrefined.com - are briefly described before jumping into the code.
Simple linear regression on an important dataset
Chapter 4 demos on two class logistic regression and support vector machines, as well as multi-class one-versus-all and multiclass softmax / logistic regression
Two class classification with logistic regression:
Multiclass classification with One-versus-All classification