Week 4 code

Hi Team

What does the lab_utils_common function do ? Why are we using custom functions ?

import numpy as np
%matplotlib widget
import matplotlib.pyplot as plt
from lab_utils_common import plot_data, sigmoid, dlc

@Jasmine7 I am not familiar with this particular course, but my general understanding is they are generally used to implement functions you have already learned to create before. This is intended to save you from writing them all over again !

And then perhaps there are a few more for the sake of the Colab presentation-- I mean I imagine that is what ‘plot_data’ is doing.

But, don’t worry, if you are truly understanding-- You are not missing any of the ‘important stuff’ because of these libraries.


Colab is not used in the MLS course.


@TMosh oh, okay, I have no idea what they are talking about/referring to then :grin:

Hello @Jasmine7

If you want to check what the lab_utils_common.py file do? Click on file then open the selected file, you’ll know what it does as this file contains some part of metadata required for you to do the assignment.

Why they have used custom function? To this we can only assume as these functions were created by dlai programmers for us to do the assignment.

You can try yourself by trying to do an assignment on your jupyter environment, that is when you will understand behind writing a code or creating a model, goes many people efforts. But you could also write this lab files yourself if you want to create any algorithm.


1 Like

You can use the File menu, open the “lab_utils_common.py” file, and read the function code for yourself.

Generally the courses use utility functions that the staff has written, to provide tools or features that are not part of the curriculum.

For example, when you want to ride in a taxi, you’re not required to know how the tires were built.

1 Like

Thanks so much that was extremely helpful.