diff --git a/ex1/ex1_multi.py b/ex1/ex1_multi.py index e635b09..478bd83 100644 --- a/ex1/ex1_multi.py +++ b/ex1/ex1_multi.py @@ -80,7 +80,9 @@ print theta # Estimate the price of a 1650 sq-ft, 3 br house -price = np.array([1,3,1650]).dot(theta) +house = np.array([1650, 3]) +house = (house - mu) / sigma +price = np.hstack((1, house)).dot(theta) print 'Predicted price of a 1650 sq-ft, 3 br house' print '(using gradient descent): ' @@ -119,7 +121,7 @@ print ' %s \n' % theta # Estimate the price of a 1650 sq-ft, 3 br house -price = np.array([1, 3, 1650]).dot(theta) +price = np.array([1, 1650, 3]).dot(theta) # ============================================================