Plot Precision Recall Curves With W&B
Plot Precision-Recall Curves with W&B
How to log Precision-Recall curves with Vega in Weights & Biases.
Method: wandb.plot.pr_curve()
- More info and customization details: Plot Precision Recall Curves
- More examples in this W&B project: Custom Charts.
These are simple cases to explain the basics—you can build much more sophisticated custom charts with our powerful new query editor.
This Colab explores a transfer learning problem: finetuning InceptionV3 with ImageNet weights to identify 10 types of living things (birds, plants, insects, etc) from 10K photos from iNaturalist 2017.

Note: Hyperparameters like number of epochs and training dataset size are set to minimum values here for demo efficiency. On the full training data, the model should get to the low 80s in validation accuracy within an epoch or so.
Setup: Download data
Note: this stage might take a few minutes (~3.6GB of data). If you end up needing to rerun this cell, comment out the first capture line (change %%capture to #%%capture ) so you can respond to the prompt about re-downloading the dataset (and see the progress bar).
Download sample data: 10,000 training images and 2,000 validation images from the iNaturalist dataset, evenly distributed across 10 classes of living things like birds, insects, plants, and mammals (names given in Latin—so Aves, Insecta, Plantae, etc :). We will fine-tune a convolutional neural network already trained on ImageNet on this task: given a photo of a living thing, correctly classify it into one of the 10 classes.
Install dependencies
Install tensorflow and wandb; log in to wandb.
Training code
Feel free to try different values for "NUM_TRAIN" and "NUM_EPOCHS" below so you can see a variety of PR curves (generally better ones with more training examples/longer training time)