Skip to content

Instantly share code, notes, and snippets.

@curiousily
Last active March 31, 2019 12:23
Show Gist options
  • Save curiousily/5def43b7aa02d616994030f61da4359f to your computer and use it in GitHub Desktop.
Save curiousily/5def43b7aa02d616994030f61da4359f to your computer and use it in GitHub Desktop.
class TestGradientDescent(unittest.TestCase):
def test_correct_prediction(self):
global X
global y
if len(X.shape) != 2:
X = X.reshape(X.shape[0], 1)
w = fit(X, y)
y_hat = predict(X, w).round()
self.assertTrue((y_hat == y).all())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment