new_contents: from regression import *
  
  # Average hourly wage
  HOURLY_WAGE = [2.98, 3.09, 3.23, 3.33, 3.46, 3.6, 3.73, 2.91, 4.25, 4.47, 5.04, 5.47, 5.76]
  # Number of homicides per 100,000 people
  MURDERS     = [8.6, 8.9, 8.52, 8.89, 13.07, 14.57, 21.36, 28.03, 31.49, 37.39, 46.26, 47.24, 52.33]
  
  LEARNING_RATE = ...
  h = ...
  PRECISION = 0.000001
  
  def Cost(B,X=HOURLY_WAGE,Y=MURDERS):
  	...
  
  
  errors = 0
  
  def check(B0, f, X, Y, eta, h, precision):
      global errors
      print "starting at", B0
      (m, steps, trace) = minimize(f, B0, eta, h, precision)
      print "gradient descent gives ", m, "Cost", Cost2(m)
  
      fit = np.polyfit(X, Y, 1)
      print "exact is               ", [fit[1], fit[0]]
      if int(m[0]*1000) != int(fit[1]*1000):
          print "Descent didn't converge to 3 decimals starting from", B0
          errors += 1
  
  check([-23, 12], Cost, HOURLY_WAGE, MURDERS, LEARNING_RATE, h, PRECISION)
  check([-50, 10], Cost, HOURLY_WAGE, MURDERS, LEARNING_RATE, h, PRECISION)
  check([-36, 17], Cost, HOURLY_WAGE, MURDERS, LEARNING_RATE, h, PRECISION)
  check([-36, 15], Cost, HOURLY_WAGE, MURDERS, LEARNING_RATE, h, PRECISION)
  check([100, 17], Cost, HOURLY_WAGE, MURDERS, LEARNING_RATE, h, PRECISION)
  check([-15, 0],  Cost, HOURLY_WAGE, MURDERS, LEARNING_RATE, h, PRECISION)
  
  if errors==0:
      print "ALL TESTS PASS"
  else:
      print "TEST(S) FAIL"
  
subject: add regression test