-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add docstrings for EvaluationRunResult (#7885)
- Loading branch information
Showing
4 changed files
with
81 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# SPDX-FileCopyrightText: 2022-present deepset GmbH <info@deepset.ai> | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from abc import ABC, abstractmethod | ||
from typing import List, Optional | ||
|
||
from pandas import DataFrame | ||
|
||
|
||
class BaseEvaluationRunResult(ABC): | ||
""" | ||
Represents the results of an evaluation run. | ||
""" | ||
|
||
@abstractmethod | ||
def to_pandas(self) -> "DataFrame": | ||
""" | ||
Creates a Pandas DataFrame containing the scores of each metric for every input sample. | ||
:returns: | ||
Pandas DataFrame with the scores. | ||
""" | ||
|
||
@abstractmethod | ||
def score_report(self) -> "DataFrame": | ||
""" | ||
Transforms the results into a Pandas DataFrame with the aggregated scores for each metric. | ||
:returns: | ||
Pandas DataFrame with the aggregated scores. | ||
""" | ||
|
||
@abstractmethod | ||
def comparative_individual_scores_report( | ||
self, other: "BaseEvaluationRunResult", keep_columns: Optional[List[str]] = None | ||
) -> "DataFrame": | ||
""" | ||
Creates a Pandas DataFrame with the scores for each metric in the results of two different evaluation runs. | ||
The inputs to both evaluation runs is assumed to be the same. | ||
:param other: | ||
Results of another evaluation run to compare with. | ||
:param keep_columns: | ||
List of common column names to keep from the inputs of the evaluation runs to compare. | ||
:returns: | ||
Pandas DataFrame with the score comparison. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters