Linear regression is a good starting algorithm for machine learning, in particular what is called supervised learning. Say you have a collection of m measurements of n parameters (features in ML lingo) along with a value you are trying to estimate with those parameters. Typically m >> n. This is really an overdetermined system of linear equations which can be attacked with least squares methods. One general method for finding the "best" solution to such problems is the so-called gradient-descent (Gauss-Newton) algorithm. Here is code for the iterative Gauss-Newton algorithm, along with an example. Note that although this example appears over-determined with 5 equations in 3 unknowns, it is really even-determined and can be solved exactly.