@@ -0,0 +1,336 @@
+def compute_cost(x,y,m,b):%0A    %22%22%22%0A    Compute the MSE cost of a prediction based on m,b%0A    %0A    x: input vector%0A    y: observed output vector%0A    m,b regression parameters%0A    %0A    Returns: cost::double%0A    %22%22%22%0A    yhat = m*x + b%0A    diff = yhat - y%0A    %0A    cost = np.dot(diff.T, diff)/float(x.shape%5B0%5D)%0A    return cost.flat%5B0%5D%0A    %0A

Create cost.py