From 9dce7d10db61e03b9613bb8212038e0a12be7ccf Mon Sep 17 00:00:00 2001 From: adrianliaw Date: Fri, 25 Nov 2016 16:52:44 +0800 Subject: [PATCH] Correct ex1's ungraded exercise's testing data point --- ex1/ex1_multi.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) # ============================================================