Housing Prices - Cant figure out what to put into the X and Y values. I need some guidance on what to put in the x and y numpy array’s to get close to 4. Can you help me out?
Hello,
You included a wrong arthematic operator and values for both XS and ys.
You have written your codes based on the ungraded lab for this week
Next up, you will feed in some data. In this case, you are taking 6 X’s and 6 Y’s. You can see that the relationship between these is y=2x-1
, so where x = -1
, y=-3
etc.
But in the assignment the only instructions given is
Define inputs and output tensor with values for houses with 1 up to 6, so this will give you xs.
based on the below statement you need to determine your ys
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.
so if you XS is 1, and what would be your ys based on the above statement.
Regards
DP
What was the wrong arithmetic operator?
Arthematic operators are +, -, *
Did you pass the test?
xs = np.array([0.0, 50000.0, 100000.0, 150000.0, 200000.0, 250000.0], dtype=float)
ys = np.array([0.0, 50000.0, 100000.0, 150000.0, 200000.0, 250000.0], dtype=float)
y=2x-1 - here is my interpretation of what you are saying:
y=(250000)-1
y=(2100000)-1
y=(2150000)-1
y=(2200000)-1
y=(2*250000)-1
99000=(250000)-1
199000=(2100000)-1
299000=(2150000)-1
399000=(2200000)-1
499000=(2*250000)-1
xs = np.array([0.0, 50000.0, 100000.0, 150000.0, 200000.0, 250000.0], dtype=float)
ys = np.array([0.0, 99000.0, 199000.0, 299000.0, 399000.0, 499000.0], dtype=float)
Am I understanding you?
no, the reason for sharing this statement from the assignment was for you to understand how for every xs, ys value need to be assigned
so if your bedroom 1, 2, 3, 4, 5, 6 (6 bedrooms) for this you need to relate your ys based on this statement from assignment
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.
read the second statement and notice with addition of bedroom the variable change to half decimal point that 0.5
so if you xs=1, ys =1 and xs =2, ys would be 1.5 and so one for xs till 6 bedroom variables.
both xs and ys should have value 6 in number as we are trying get a relation how sales price get affect based on number of bedrooms.
Hope now you understood!!!
Regards
DP
Yay!!! Yes, that was helpful. Thank you for being so patient.
Keep learning!!!
Happy to help!
Remember most of the assignment have all kinds hints in the form instructions, or the error log you get, or grader output on why it failed. So always look into those details and then search in the platform with the similar issue you are facing. Most of the time people have already come across such issue and they have found solution on platform, so looking into those post will also help you understand and getting the right code. Otherwise, mentors are always there to help everyone.
Regards
DP