Skip to content
← All PyTorch tracks

Metrics & Evaluation

PyTorch

The numbers that tell you whether your model is actually working — accuracy, F1, AUC, perplexity, BLEU.

7 exercises

Explore freely. Sign in to keep your progress.

Your learning sequence

  1. 1 Not solved yet. Accuracy – Multiclass Practice · Easy
  2. 2 Not solved yet. Confusion Matrix Practice · Easy
  3. 3 Not solved yet. Precision, Recall & F1 Practice · Medium
  4. 4 Not solved yet. AUC-ROC Practice · Medium
  5. 5 Not solved yet. Expected Calibration Error Practice · Medium
  6. 6 Not solved yet. Perplexity from Logits Practice · Easy
  7. 7 Not solved yet. BLEU-1gram Practice · Medium

Check yourself

4 questions · not saved while you're signed out

Use these questions to check your understanding and compare explanations. Your score does not affect track completion.

0 / 4 correct

With one positive among 100 examples and every prediction negative, what are accuracy and positive-class recall?

Choose one answer to reveal the explanations. Answers are kept only while this page is open.

y = [1] + [0] * 99
pred = [0] * 100
correct = sum(a == b for a, b in zip(y, pred))
true_positives = sum(a == 1 and b == 1 for a, b in zip(y, pred))
print(f"accuracy = {correct / len(y):.2f}")
print(f"recall = {true_positives / sum(y):.2f}")
Question 1 of 4