Skip to content

01_pytorch_workflow_video.ipynb : generating plot predictions #275

Answered by mrdbourke
rnainggo asked this question in Q&A
Discussion options

You must be logged in to vote

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

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

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ozzyoz14
Comment options

@mrdbourke
Comment options

Answer selected by mrdbourke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants