Skip to content

Instantly share code, notes, and snippets.

@curiousily
Created March 30, 2019 22:13
Show Gist options
  • Save curiousily/57fcdc70d2da9baf5354a3958711abeb to your computer and use it in GitHub Desktop.
Save curiousily/57fcdc70d2da9baf5354a3958711abeb to your computer and use it in GitHub Desktop.
X = df['amount_spent'].astype('float').values
y = df['send_discount'].astype('float').values
def predict(x, w):
return sigmoid(x * w)
def print_result(y_hat, y):
print(f'loss: {np.round(loss(y_hat, y), 5)} predicted: {y_hat} actual: {y}')
y_hat = predict(x=X[0], w=.5)
print_result(y_hat, y[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment