Skip to main content

Dataframe Evaluation Methods (Python only)

  • evaluate_dataframe for synchronous dataframe evaluations
  • async_evaluate_dataframe an asynchronous version for optimized speed and ability to specify concurrency.
Both methods run multiple evaluators over a pandas dataframe. The output is an augmented dataframe with two added columns per score:
  1. {score_name}_score contains the JSON serialized score (or None if the evaluation failed)
  2. {evaluator_name}_execution_details contains information about the execution status, duration, and any exceptions that occurred.

Notes:

  • Bind input_mappings to your evaluators beforehand so they match your dataframe columns.
  • Failed evaluations: If an evaluation fails, the failure details will be recorded in the execution_details column and the score will be None.

Examples

  1. Evaluator with more than one score returned:
  1. Running multiple evaluators, one bound with an input_mapping:
  1. Asynchronous evaluation
See Using Evals with Phoenix to learn how to run evals on project traces and upload them to Phoenix.