Housing price Week 1 Assignment

Hello Everyone,

I’m not able to pass the test cases with the below code. I have attached the program file for your
reference.
Issue - I’m getting the output as 4 for the prediction but after submitting the assignment the code is
not passing the test cases.
Please help to fix the issue…!!

{mentor edit: code removed}

Hello @PRATIK_PHIRKE ,

Welcome to our Community!

I have gone through your Notebook.

  1. At first as per the instruction, you have to take only 6. You have taken here 7.
# Define input and output tensors with the values for houses with 1 up to 6 bedrooms
# Hint: Remember to explictly set the dtype as float
  1. Instruction is given to take 1000 epochs, you have taken 750.
# Train your model for 1000 epochs by feeding the i/o tensors
  1. Under prediction part, it was by default probably given
prediction = model.predict([new_y])[0]

But you have written something else.

Make these following changes.It should pass. I just now passed again with 100%.So there is no internal issue.

Hope this helps.

With regards,
Nilosree Sengupta

Hello @nilosreesengupta,

Thank you for your response.
I did changes as instructed by you but still, I’m not able to pass.

I have attached the notebook and test case fail screenshot for your reference.

can you please guide me on that?

Regards,
Pratik


{mentor edit: code removed}

Hello @PRATIK_PHIRKE ,

The values for ys are too high compared to xs. Make ys compatible to xs. When xs is 1.0, ys 100.0 is too way high. xs is okay. Change your ys shifting decimal by 2 places.

With regards,
Nilosree Sengupta

Hello @PRATIK_PHIRKE ,

And another thing, you can post all your problems, doubts, discuss errors and stuffs, errors, snippets, post the screenshots on discourse freely.

But, don’t post your full notebook openly on Discourse.So that other learners don’t see your solution and does the coding of their own.You can send it to me or any mentors for help, personally through dm.By clicking on the profile picture, you will see an option to message.There you can attach your notebook.
Then we can discuss the issues here, under the topic you created, on discourse.

With regards,
Nilosree Sengupta

Hello @nilosreesengupta,

Thank you for the help.
I was able to pass the assignment.

Regards,
Pratik

Hello @PRATIK_PHIRKE ,

You are welcome!
Basically with values of ys you gave it was giving output 400.5. Whereas prediction is supposed to be around 4 as per the test case. From next time just be careful with values and the instructions of the notebook.

Post in the discourse whenever you will get stuck.We all are here to help you.
Happy Learning!

With regards,
Nilosree Sengupta

It appears that the notebooks and the quiz(s) are being updated to imply we should be knowledgeable of using a new TF api but I am not seeing the materials mentioning this. For example, in the quiz if you answer the question “When building a TensorFlow Keras model…?” with "Setting the input shape…" answer, the feedback will be something like “Using the new API…”

In the assignment there is a block of code like:

    # Define your model
    model = tf.keras.Sequential([ 
		# Define the Input with the appropriate shape
		None,
		# Define the Dense layer
		None
	])

Which suggests that there is a different syntax for defining tf.keras.Sequential() than was demonstrated in the videos and example notebooks, and without materials to help with that it makes the the API guide (https://www.tensorflow.org/guide/keras/sequential_model) difficult tho navigate to find the answer.

Thanks for bringing this up. I’ve asked the staff to add a release note regarding changes that went into the specialization and options you have to catch up.

That said, course videos have also been updated to cover the latest update. If you see a case where the course videos / ungraded labs don’t contain sufficient information for answering a quiz question, please provide the link to the quiz & quiz question.