Here are implementations of some of the algorithms I learnt in my ML class with David Sontag.
If you are taking CS480-ML at NYU, be mindful that viewing or referencing this code is likely in violation of the honor code that was specified by your professor, so don't do it.