machine learning class exercise teached by Prof.Andrew Ng