Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jtlowery committed Mar 12, 2017
1 parent 629f727 commit c3c792d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ex1/ex1.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@
for j in range(theta1_vals.size):
t = np.array([theta0_vals[i], theta1_vals[j]])
col.append(computeCost(X, y, t.T))
J_vals = np.column_stack((J_vals,col))
J_vals = np.column_stack((J_vals, col))

# Because of the way meshgrids work in the surf command, we need to
# transpose J_vals before calling surf, or else the axes will be flipped
J_vals = J_vals[:,1:].T
J_vals = J_vals[:, 1:].T
theta0_vals, theta1_vals = np.meshgrid(theta0_vals, theta1_vals)

# Surface plot
Expand Down Expand Up @@ -152,7 +152,7 @@

plt.figure()
plotData(x=data[:, 0], y=data[:, 1])
plt.plot(X[:, 1], X.dot(regr.coef_), '-', color='black', label='Linear regression wit scikit')
plt.plot(X[:, 1], X.dot(regr.coef_), '-', color='black', label='Linear regression with scikit')
plt.legend(loc='upper right', shadow=True, fontsize='x-large', numpoints=1)
show()

Expand Down
2 changes: 1 addition & 1 deletion ex1/normalEqn.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np


def normalEqn(X,y):
def normalEqn(X, y):
""" Computes the closed-form solution to linear regression
normalEqn(X,y) computes the closed-form solution to linear
regression using the normal equations.
Expand Down

0 comments on commit c3c792d

Please sign in to comment.