Assignment: Housing Prices

Not sure what’s wrong. I keep failing.

xs = np.array([1.0,2.0,3.0,4.0,5.0,6.0,7.0], dtype= float)
ys = np.array([100.0,150.0,200.0,250.0,300.0,350.0,400.0], dtype=float)

Per instructions, I’m running 1000 epochs. I’m predicting 7 . The output is [400.3361].

I ran 4000 epochs and got an output of: [400.00024]. Not sure what the point of this is?
Any ideas?
Thanks

3 Likes

Hey David!

Welcome to the discourse! Glad to have you posting!

I would pay close attention to this hint, and give it another go!

Hint: Your network might work better if you scale the house price down. You don’t have to give the answer 400…it might be better to create something that predicts the number 4, and then your answer is in the ‘hundreds of thousands’ etc.

Let me know how that goes! :smiley:

3 Likes

Hi…
i have tried to make the code, the end of the result is approximately almost 400. But the problem is when i want to submit, i still got 0 for my task. What happened? would you like to help me, please?

i have been trying for a lot of time, still didn’t pass :frowning:

xs = np.array ([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0], dtype=float)
ys = np.array ([100.0, 150.0, 200.0, 250.0, 300.0, 350.0, 399.0], dtype=float)

end result [399.8723]

1 Like

Hi @Rifah_Maulidya, thanks for reaching out.
Please train your model from a house with one bedroom up to 6 bedrooms only, don’t include 7 bedrooms in the training.
For the prices do as this hint pointed out:

Blockquote
Hint: Your network might work better if you scale the house price down. You don’t have to give the answer 400…it might be better to create something that predicts the number 4, and then your answer is in the ‘hundreds of thousands’ etc.

Instead of 100.0 try 1.0 etc…
Keep us posted on the results :smiley:

2 Likes

What does the grader output say?

1 Like

Failed test case: model has incorrect type.
Expected:
<class ‘keras.engine.training.Model’>,
but got:
<class ‘NoneType’>.

That’s what the grader say
I don’t what the problem…

1 Like

Oh, that’s very simple, the graders were updated recently. Just make sure you have the latest version of the notebook and the problem will be solved.

Please follow these steps, then try your code again.

  1. O​pen the notebook from the classroom.
  2. After the notebook opens up, c​lick File → Open
  3. W​hen your workspace opens, tick the check box before your notebook file. After it is selected, press Shutdown. The icon beside the filename should turn from green to gray.
  4. Tick the checkbox again and this time choose Rename and enter any filename other than the original. For example, C4W1_Assignment.ipynb (original) → C4W1_Assignment_v2.ipynb
  5. (Optional) Tick the checkbox of any other file that you want to get a fresh copy of (e.g. dataset files that you might have manipulated irreversibly). Then click Delete . You can also opt to Rename or Download each file individually in case you want to keep them before deleting.
  6. Click on the Help button on the top right of the page.
  7. Click the Get latest version button.
  8. Click the Update Lab button. The page will refresh and you should now see the latest version of the notebook.

If the error still remains, just tell me. I’ll assist you until you get 100/100 :smiley:

1 Like

i have followed step by step above, but still didn’t pass for the grade :frowning:

the grader said this " There was a problem compiling the code from your notebook. Details: ‘NoneType’ object has no attribute ‘compile’ "

for model compile, I have entered optimizer=sgd with loss button=mean_squared_error

what should i do?

1 Like

Could you please try saving your notebook before submitting

1 Like

i have saved it. But still zero grade :sweat:

Download your notebook, Click my name and send it to me in a private message.

1 Like

@Rifah_Maulidya, I received your code and it looks perfect, the problem is in the notebook itself.
I want you to:
1-C​lick File → Open
2-check box before your notebook file. After it is selected, delete it.
3-Upload this notebook instead and fill the graded function with yours.

PS: make sure the name is C1W1_Assignment.ipynb and nothing else, otherwise the submission will fail.

C1W1_Assignment.ipynb (4.3 KB)

This has happened before to somebody else on C1W2.

2 Likes

the same problem. i have followed your suggest :")

So sorry to see that, but this worked out with me, I dunno why it didn’t with you.

@a-zarta could you please look into @Rifah_Maulidya 's problem!

Hi @Rifah_Maulidya, send me your notebook in a DM and I will take a look

2 Likes

Hi
Thank you for your help and suggestion, finally i’ve got 100 for my first assignment :smiley:

5 Likes

My pleasure, Happy learning!

3 Likes

Hi CSAAlexiuk, i still could not understand how to fill the tensors accuratley.

For xs we have to mention number of bedrooms in floating number

For ys What exactly should be written, please guide me.

Regards

1 Like

Hello @ZESHAN_MUMTAZ, welcome to the community.
ys should be the price of the house based on the number of bedrooms.

Blockquote
A house has a base cost of 50k, and every additional bedroom adds a cost of 50k. This will make a 1 bedroom house cost 100k, a 2 bedroom house cost 150k, etc.

Blockquote
Hint: Your network might work better if you scale the house price down.

For a house with one bedroom, the price is 1.0, a 2 bedroom house is 1.5, etc.

1 Like

Same problem with a failed submission
While my code works exactly as the guide predicts
Can some one help please

1 Like