Skip to main content
This is an interactive notebook. You can run it locally or use the links below:

Leaderboard Quickstart

In this notebook we will learn to use Weave’s Leaderboard to compare model performance across different datasets and scoring functions. Specifically, we will:
  1. Generate a dataset of fake zip code data
  2. Author some scoring functions and evaluate a baseline model.
  3. Use these techniques to evaluate a matrix of models vs evaluations.
  4. Review the leaderboard in the Weave UI.

Step 1: Generate a dataset of fake zip code data

First we will create a function generate_dataset_rows that generates a list of fake zip code data.

Step 2: Author scoring functions

Next we will author 3 scoring functions:
  1. check_concrete_fields: Checks if the model output matches the expected city and state.
  2. check_value_fields: Checks if the model output is within 10% of the expected population and median income.
  3. check_subjective_fields: Uses a LLM to check if the model output matches the expected “known for” field.

Step 3: Create a simple Evaluation

Next we define a simple evaliation using our fake data and scoring functions.

Step 4: Evaluate a baseline model

Now we will evaluate a baseline model which returns a static response.

Step 5: Create more Models

Now we will create 2 more models to compare against the baseline.

Step 6: Create more Evaluations

Now we will evaluate a matrix of models vs evaluations.

Step 7: Review the Leaderboard

You can create a new leaderboard by navigating to the leaderboard tab in the UI and clicking “Create Leaderboard”. We can also generate a leaderboard directly from Python: