Map columns in datasets

no
Summary: Map columns in datasets to different names. This helps you align the column names in your dataset with the column names expected by the scorer.

Original Documentation

Documentation Index#

Fetch the complete documentation index at: https://docs.wandb.ai/llms.txt Use this file to discover all available pages before exploring further.

Map columns in datasets to different names. This helps you align the column names in your dataset with the column names expected by the scorer.

In the Weave Python SDK, use the column_map attribute on a scorer to map its expected parameter names to your dataset’s column names. The mapping format is {scorer_parameter: dataset_column}.

The following example maps the output and target parameters to a dataset’s model_output and answer columns:

    from weave.scorers import EmbeddingSimilarityScorer

    similarity_scorer = EmbeddingSimilarityScorer()

    similarity_scorer.column_map = {
        "output": "model_output",  # The model's generated text
        "target": "answer"         # The expected or reference response
    }
    ```

For more details on scorer column mapping, see [Mapping Column Names with `column_map`](../evaluation/scorers#mapping-column-names-with-column_map).
  <span class="tab-end"></span>

  <span class="tab-start" data-tab-title="TypeScript"></span>
In the Weave TypeScript SDK, column mapping is configured on the `Evaluation` object using the `columnMapping` option, not on individual scorers. The mapping format is `{scorer_key: dataset_column}`.

The following example maps `expectedOutputTimesTwo` (used by the scorer) to the `expected` column in the dataset:

```typescript
    import * as weave from 'weave';

    const myScorer = weave.op(
      ({modelOutput, datasetRow}) => {
        return modelOutput * 2 === datasetRow.expectedOutputTimesTwo;
      },
      {name: 'myScorer'}
    );

    const myEval = new weave.Evaluation({
      id: 'my-evaluation',
      dataset: [{expected: 2}],
      scorers: [myScorer],
      columnMapping: {expectedOutputTimesTwo: 'expected'},
    });
    ```

For more details on TypeScript scorer arguments, see [Scorer Keyword Arguments](../evaluation/scorers#scorer-keyword-arguments).
  <span class="tab-end"></span>
<span class="tab-group-end"></span>
Link last verified June 7, 2026. View original ↗
Source: Weights & Biases Docs
Link last verified: 2026-03-04