On The Verge Of Doing The Practice Lab Week 2

Hi all,

I’ve studied quite a bit the material and the codes of all weeks and yesterday I tried to see the demands of Practice Lab Week 2, The Linear Regression with 1 variable.

1.) First of all, when the function says “load data” I don’t see any data loaded in the lab. Does this mean the class has loaded the data in the backend?

2.) Second question. You ask us to compute the cost function for linear regression and also compute gradient descent for linear regression. From a mere browsing of the flow of codes, before the tasks, I tried to understand the before and after. Is there a relation between x_train, y_train, and x and y as imported at the beginning samples of codes and also the tasks requested?

Meaning, how does the program know if there is any kind of relationship or there isn’t, between x_train, y_train and x, y in the tasks?

3.) If I want to submit the assignment do I have to just press the “Submit Assignment” button? Can I also Save the assignment for later use?

4.) I ask about Saving the assignment for the same reason I wanna know how to share my screen in the lab for possible future support from your staff. Besides the advice from Coursera, how am I supposed to get academic support from formal staff in the sense of a unique professor?

Looking forward for your reply

Thanks in advance!

Hello Menelaos,

  1. There is a function called load_data() already defined in the files that you can access by clicking on the lab files button on the top right corner and going deep into the folders. Load_data() is actually a function that was written by one of the course TA’s I believe which will help us in using that function by importing it. You can re-write the same function if you want or else you can create new function and keep them in a .py file. You can import them as necessary. You can see from the assignment notebook that the load_data function is being imported from a file.

  2. X and y is the whole data that you imported using the load_data function. As a machine learning paradigm, you create a sample of dataset called “Training data” on which the model is trained on which is why we created a subset called X_train and y_train. Once your model has been trained on the training data, you can feed it with new/unseen data also known as “Test data” to check the performance of it. And, if you feed the whole data, there is no way you can check the performance of it.

  3. Once you have done some part of the assingment, you can download the file and save it on your local device. There is no save option except the submit button to submit the assingment.

  4. There are many co-learners like me out there and highly qualified Teaching Assistants who will help you in solving any problem you may get. They might ask you for your .IPYNB file (Assignment file) if they can’t figure the error that you are facing.

If you have any doubts, feel free to post in the discussion. As always happy to help you.


1 Like

Hello Ajay,

It seems that you are very liberal in your expressions and I still don’t understand which parts will be created by me and which parts are already made in the algorithm.

The practice lab suggests at the top that in order to avoid errors in the auto-grader we should not alter non-graded cells. So:

1.) Do I have to alter anything in the cell In [3]? What do you mean re-write the same function or create a new function and keep them in a .py file? The lab so far allows me to save the entire page but nothing smaller or a part of it. How could I save a function in a .py file? Aren’t I supposed not to change anything in In [3]?

In any case which will be my data to run the program?

2.) Do I have to train the model with data or do I have to run an algorithm based on the 2 requested tasks? So far I know I have to complete 2 tasks with 2 graded pieces of code in Lab 2. Why should I worry about the entire process of machine learning since it seems that - based on the code samples studied from classes - it may be nothing more than 2 careful copy pastes? And when you say part of the data or whole data, at which data do you refer? Again, we’re talking about writing 2 pieces of code, not organize or pre-process data, why the mention?

3.) I knew that I can save the assignment on the browser’s lab. Do I also have the option to save the lab in my local device? And how should I open it and with what code installed can I re-process it?

4.) I don’t understand what is a .IPYNB file and how to possess it but most of all, as you stil haven’t answered to me, how we are supposed to synchronize communication with the staff. Can you explain?

Since you’re rather very complicated in your previous explanation I would appreciate your timely response this time, for time is running out.

Looking forward for your reply


Can you share me your notebook? As I completed the course long back, I don’t have a copy of it saved. Once I see the notebook, i can answer the questions 1 and 2 in a detailed manner. You can send it via a personal message.

Coming to the rest,

  1. You can’t save the entire lab at once. First, you can download the notebook (THE ACTUAL ASSIGNMENT FILE that you are working now) by clicking on file on the top left corner and click download. You can see there are a couple of options. You can concentrate on the one with Notebook (.IPYNB) extension. To open the files with this extension, you need to download a package called anaconda. You can find it at https://www.anaconda.com/. The steps are quite easy as same as how you would install a normal software.
    You can also download the files from the Lab files section at the top right corner where you have access to the functions that were defined already. I can show them to you and explain the step by step once I get the notebook

  2. The file on which you are working right now solving the assignment is called a Jupyter notebook (A Notebook in short) which has an extension of .IPYNB format. The advantage of using this format is that the output is shown after each cell is executed. Instead of writing all the code in one code block, you write each line in one code block which will help in the process of identifying errors easily. Coming to the communication part, It is asynchronous. You post your query and then the TA or a member of the community will answer your question. If it is not clear from the question or if there are any discrepancies, they might ask you to share your notebook file which will help them in explaining them clearly.

And, Sorry for the previous message. If there is anything else, please let me know. happy to help you.

Hello @Menelaos_Gkikas,


Coursera should keep your notebook throughout the period of your current subscription. So yes, you can save it and it will remain on coursera. Or you can download the whole notebook for future reference. Note that, after your current subscription period is ended, based on what I know, you won’t have access to any assignment or lab notebooks. If you want to know how to backup, check this instruction out.

Also, you can save your notebook on coursera as many times as you like. You can close and reopen it as many times as you like. You can submit your notebook for grading as many times as you like. There is no penalty. There is no time limit except for your subscription period.

The thing that I would strongly recommend is for you to finish the whole assignment on the coursera environment. There have been reports of problem when learners had finished the assignments on their machine and uploaded it back for submission but failed. Most of the time the quickest fix is for the learners to copy-and-paste the work from the notebook on the local machine to that on coursera.

If you follow the instruction in the link I provided, you will download your assignment/lab as a “jupyter notebook” which has a file extension called “.ipynb”. You will need to install “jupyter lab” to open, edit, and run it. For details, please google “How to install jupyter lab on XXX” and replace “XXX” with the name of your OS. You will end up a interface quite similar to coursera’s but with more functionality.

This is how this place works. If you want to ask about an error, take a screenshot of the full error traceback or the full error message that inform you of a problem. Then open a new thread in the corresponding category of this community, and share the screenshot(s) and tell us which notebook it is and any other relevant information. Mentors or fellow learners who have some suggestions for you will reply to your thread. However, sharing assignment code is against the rules of this community, so please don’t do it.

As far as I know, we don’t have tutoring sections or individual sections here. So, your first aid would be the hints provided in the assignment notebook under each exercise, googling the internet, and searching in this community. Second aid will be posting in the community.

If you have any question about your account or any problem with the Coursera platform, they should be sent to Coursera directly. Check this out for contacts.


Nothing seems to happen because the data is loaded into the variables x_train and y_train quietly. However, in the next few cells, you will run through some commands to visualize part of the data. If you want to really look at the data, this is how you can trace back to its source:


The load_data function comes from util which is a script file called “util.py” and you can locate it by clicking “File” > “Open” to open a file browser, and you can click “util.py” to check out the loaddata function. It will have a source file path of the data, and you only need to follow that path in the file browser to get to that source.


Hello folks,

Lots of information to be considered but there is progress. I have completed the assignment and below I took screenshots of the later verification code naming the files Graded Function 1 and Graded Function 2 - I needed to add a second initialization value to match the names of the code and that’s in Function 1- . Here they are:

First of all, do you see any errors or something peculiar? I haven’t yet submit the project (I have run all the codes including the next ones) and I wanna know If I can now submit the whole program since there is the button at the top.

I have saved the program in the browser of Coursera but I have also downloaded the file that appears with an icon of a byproduct of Word with the extension IPYNB. To get Anaconda and be able to run it on my own I will have to follow your previous instructions.

If I get Anaconda does this mean I will be able to write and run code in the new environment as I do with your Browser?

Furthermore, in order for me to share my notebook with you it means I will have to click at Help at the top right corner and give you my Lab ID, right? Is that only it? And where can I send such a confidential information?

Independent from the answers to the previous, is there something more to be done since the Assignment is completed? Am I ready to Submit my project?

Looking forward for your reply

Thanks in advance!


Yes, if you have all the files downloaded and an Anaconda environment with the correct libraries then it will work.

If you need to share something with a mentor privately get their permission and then go ahead and send them a direct message.

If all of the questions are answered and you are satisfied with your work go ahead and submit!

Hi all,

I made it! I submitted my work, and passed with 100!

1.) What do you mean I need the correct libraries when it comes to Anaconda?

2.) When I get a permission from a mentor, does this mean mailing them? How?

Furthermore, I suppose now that we have come up with Jupyter Notebooks and Anaconda, installing Python for example, etc, we will be supposed to get the software installations and after the end of net classes, practice on our own, right?

Do you provide information of how to install the real software products to better prepare for what’s next?

Looking forward for your reply


Hi @Menelaos_Gkikas

  1. When working with Anaconda, it is important to have the correct libraries and packages installed in order to run the code and perform the tasks required in the course. These libraries and packages may include popular deep learning frameworks like TensorFlow and PyTorch, as well as other libraries and packages that are used for data manipulation, visualization, and other tasks.
  2. When you get permission from a mentor, it typically means that they have agreed to provide guidance and support for a specific project or task. This can be done through email, direct messaging, or other means of communication. However, it’s best to check the guidelines of the specific course or program you are enrolled in, as the method of communication may vary.
  3. Yes, after completing the course, it is important to practice and apply what you have learned on your own. Using tools like Jupyter Notebooks and Anaconda can help you to continue to build your skills and gain hands-on experience with deep learning and other AI technologies.
  4. Many courses and programs do provide information on how to install software and tools, such as Jupyter Notebooks and Anaconda, as well as other deep learning frameworks and libraries. Additionally, you can find installation guides and tutorials on the internet. But if you have specific issues or questions, it’s always a good idea to ask your mentor or the course instructors for help.

Muhammad John Abbas

Hello Muhammad,

When you say communicate with a mentor via email, do you actually mean, to click on your names, e.g. the way I see you in this forum and send the message?

It appears a pop up window with the message but clicking on the message button after clicking at your name in the forum is the only way I searched right now to find out how to direct message someone.

Is this the case, or should I know someone’s email which is impossible?

Looking forward to hearing from you


If a mentor wants to see your code, we’ll ask you to send it to us via a private message.

You send a private message by clicking on a user name and selecting the “Message” button.

Please don’t contact the mentors directly unless we ask you to. We’re mostly all volunteers and not DLAI employees, so we have lots of other things going on besides helping here.

I don’t think anyone gives out their private email address.

1 Like

Thanks for contributing @TMosh

I was just telling the ways you can adopt to solve
You can privately text and share the code when asked

Muhammad John Abbas