Skip to content

Instantly share code, notes, and snippets.

@bobbywlindsey
Created October 7, 2019 21:30
Show Gist options
  • Save bobbywlindsey/432ecbe17e4bf2d27fd0b28d43f89d2c to your computer and use it in GitHub Desktop.
Save bobbywlindsey/432ecbe17e4bf2d27fd0b28d43f89d2c to your computer and use it in GitHub Desktop.
Predict first sample with perceptron
weights = initialize_weights(train_data.shape[1])
vector = train_data.loc[0].values
label = train_label.loc[0]
prediction = predict(vector, weights, 'step')
error = label - prediction
print(f'Prediction: {prediction}, Label: {label}, Error: {error}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment