There are ways to customize your evals that do not require creating Metrics from scratch:
- Add a custom text descriptor for row-level evaluations.
- Use a built-in template to create a custom LLM-based evaluator.
- Implement a custom data drift detection method reusing existing renders.
- (Required). Implementing the Metric calculation method.
- (Optional). Defining the default Test conditions that apply when you run Tests for this Metric (with or without Reference) without passing a custom condition.
- (Optional). Creating a custom visualization for this Metric using Plotly. If you skip this, the Metric will appear as a simple counter in the Report.
Example implementation
This is advanced functionality that assumes you’re comfortable working with the codebase. Refer to existing metrics for examples. To implement the visualization, you must be familiar with Plotly.
MyMaxMetric
which calculates the maximum value in a column.
Imports:
result.widget
as shown in the code.
Example use
Once implemented, you can reference your custom Metric in a Report as usual. Let’s create a sample toy dataset:MyMaxMetric
to the Report:
Want a Metric added to the core library? Share your idea or feature request by opening a GitHub issue.