Skip to main content

class EvalTable

Description

A Table subclass that routes run.log() to the new Eval Tables experience. When logged via run.log(), an EvalTable is logged as a Weave Eval via weave.EvaluationLogger instead of being uploaded as a regular wandb Table artifact. Note: EvalTable is a work-in-progress and is NOT yet officially released or supported.

Args

  • columns: Names of the columns in the table. If unset, but input_columns, output_columns, or score_columns are set, then we’ll just set columns to the union of those, in that order.
  • data:
  • rows:
  • dataframe:
  • dtype:
  • optional:
  • allow_mixed_types:
  • log_mode: Controls how the table is logged when the same EvalTable is passed to run.log() more than once.
    • “IMMUTABLE” (default): full table logged on first run.log(); subsequent run.log() calls are no-ops.
    • “MUTABLE” and “INCREMENTAL”: not currently supported for EvalTable.
  • input_columns: Names of the input columns. If set, designates these columns as inputs. Eval comparisons will match rows based on matching values from input columns. If unset, we will inject a “row” index input column so comparisons can match against that.
  • output_columns: Names of the output columns. These represents the values to be compared. Any columns not designated as input, output, or score will default to being output columns.
  • score_columns: Names of the score columns. These represent derived scores for the outputs. By default, we will auto-summarize any numeric and boolean scores.
  • unsupported_media_mode: How to handle unsupported wandb media/value types.
    • “stub” (default): log unsupported values as short placeholder strings like “[wandb.Html not yet supported]”. (This is a temporary flag for use during development.)
    • “raise”: fail fast when unsupported wandb value types are added.

Methods

method EvalTable.add_column()

Adds a column of data to the table.
Arguments
  • name: (str) - the unique name of the column
  • data: (list | np.array) - a column of homogeneous data
  • optional: (bool) - if null-like values are permitted

method Table.add_computed_columns()

Adds one or more computed columns based on existing data.
Arguments
  • fn: A function which accepts one or two parameters, ndx (int) and row (dict), which is expected to return a dict representing new columns for that row, keyed by the new column names.
    • ndx is an integer representing the index of the row. Only included if include_ndx is set to True.
    • row is a dictionary keyed by existing columns

method EvalTable.add_data()

Adds a new row of data to the table. The maximum amount ofrows in a table is determined by wandb.Table.MAX_ARTIFACT_ROWS. The length of the data should match the length of the table column.
Arguments
  • data:

method Table.add_row()

Deprecated. Use Table.add_data method instead.
Arguments
  • row:

method Table.cast()

Casts a column to a specific data type. This can be one of the normal python classes, an internal W&B type, or an example object, like an instance of wandb.Image or wandb.Classes.
Arguments
  • col_name: The name of the column to cast.
  • dtype: The target dtype.
  • optional: If the column should allow Nones.

method Table.get_column()

Retrieves a column from the table and optionally converts it to a NumPy object.
Arguments
  • name: (str) - the name of the column
  • convert_to: (str, optional)
    • “numpy”: will convert the underlying data to numpy object

method Table.get_dataframe()

Returns a pandas.DataFrame of the table.

method Table.get_index()

Returns an array of row indexes for use in other tables to create links.