Solutions to Machine Learning Programming Assignments

This post contains links to a bunch of code that I have written to complete Andrew Ng’s famous machine learning course which includes several interesting machine learning problems that needed to be solved using the Octave / Matlab programming language. I’m not sure I’d ever be programming in Octave after this course, but learning Octave just so that I could complete this course seemed worth the time and effort. I would usually work on the programming assignments on Sundays and spend several hours coding in Octave, telling myself that I would later replicate the exercises in Python.

If you’ve taken this course and found some of the assignments hard to complete, I think it might not hurt to go check online on how a particular function was implemented. If you end up copying the entire code, it’s probably your loss in the long run. But then John Maynard Keynes once said, ‘In the long run we are all dead‘. Yeah, and we wonder why people call Economics the dismal science!

Most people disregard Coursera’s feeble attempt at reigning in plagiarism by creating an Honor Code, precisely because this so-called code-of-conduct can be easily circumvented. I don’t mind posting solutions to a course’s programming assignments because GitHub is full to the brim with such content. Plus, it’s always good to read others’ code even if you implemented a function correctly. It helps understand the different ways of tackling a given programming problem.

ex1
ex2
ex3
ex4
ex5
ex6
ex7
ex8

Enjoy!

 

14 thoughts on “Solutions to Machine Learning Programming Assignments

  1. It is irrelevant whether GitHub is full to the brim. You are making the problem worse. It is disrespectful to all your fellows who are putting in the hard work. Some people may actually want to use their certificate to advance in their careers. You are weakening the value of the certificate. Please consider removing the solutions.

    Liked by 1 person

    • How is it irrelevant that GitHub already has solutions to programming assignments? I am grateful for Andrew Ng’s content on Coursera, but the MOOC ecosystem can hardly contain this sort of behavior unless MOOCs put in effort to keep changing assignment problems in each session the course is offered.

      Like

  2. Hi,
    Do you have an idea where can I find these assignments unsolved? The new session start only on september 5th, and I’d like to start working on the second exercise before.
    Thanks.

    Like

  3. Please I would like to learn how to write codes. I registered for machine learning with coursera. We use octave to write the codes. Although I understand the lecturers , I still don’t understand how to write codes

    Like

  4. ScholarsPro is a prominent name in the online training industry, known for its world-class training and consulting solutions for internationally recognized certifications and leading technologies such as Big Data Hadoop, SAS, Python, Data Science, ITIL, PRINCE2, Scrum, PMP, and many more. With a powerful team comprising of international scholars, certified trainers, and industry experts, ScholarsPro stands strong in the training and consulting sector, assisting professionals from diverse industry domains from all over the world, fulfill their professional development endeavors.

    Like

  5. Hi,
    Do you have an idea where can I find these assignments unsolved? The new session starts only on September 5th, and I’d like to start working on the second exercise before.
    Thanks.

    Like

  6. !! Submission failed: structure has no member ‘assignmentKey’=how to resolve this..i copy pasted the same whats in the answer

    Like

Leave a comment