-
Beta Was this translation helpful? Give feedback.
Answered by
mrdbourke
Jan 26, 2023
Replies: 1 comment 2 replies
-
Hey @rnainggo, What have you tried so far? The error is saying that the function From notebook 01: https://github.com/mrdbourke/pytorch-deep-learning/blob/main/01_pytorch_workflow.ipynb def plot_predictions(train_data=X_train,
train_labels=y_train,
test_data=X_test,
test_labels=y_test,
predictions=None):
"""
Plots training data, test data and compares predictions.
"""
plt.figure(figsize=(10, 7))
# Plot training data in blue
plt.scatter(train_data, train_labels, c="b", s=4, label="Training data")
# Plot test data in green
plt.scatter(test_data, test_labels, c="g", s=4, label="Testing data")
if predictions is not None:
# Plot the predictions in red (predictions were made on the test data)
plt.scatter(test_data, predictions, c="r", s=4, label="Predictions")
# Show the legend
plt.legend(prop={"size": 14}); |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
mrdbourke
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @rnainggo,
What have you tried so far?
The error is saying that the function
plot_predictions()
is not available, have you tried to define it?From notebook 01: https://github.com/mrdbourke/pytorch-deep-learning/blob/main/01_pytorch_workflow.ipynb