Skip to content

Instantly share code, notes, and snippets.

@vamc-stash
Last active May 19, 2020 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vamc-stash/5dab6347b1405fd48def0524af033c63 to your computer and use it in GitHub Desktop.
Save vamc-stash/5dab6347b1405fd48def0524af033c63 to your computer and use it in GitHub Desktop.
predictions
def predict(X,Y,model):
m = X.shape[0]
res = np.zeros(m)
probabs, stashes = forward_pass(X,model)
for i in range(0,probabs.shape[0]):
if probabs[i][0] > 0.5:
res[i] = 1
else:
res[i] = 0
print("Accuracy: "+str(np.sum(res == Y)/m))
return res
train_data_prediction = predict(x_train,y_train,model)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment