Andrew Ng's machine learning class exercise and my solution.