trulens.dashboard.display¶
trulens.dashboard.display
¶
Classes¶
Functions¶
get_icon
¶
get_icon(fdef: FeedbackDefinition, result: float) -> str
get_feedback_result
¶
Retrieve the feedback results including metadata (such as reasons) for a given feedback name from a TruLens record.
PARAMETER | DESCRIPTION |
---|---|
tru_record
|
The record containing feedback and future results.
TYPE:
|
feedback_name
|
The name of the feedback to retrieve results for.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
DataFrame
|
pd.DataFrame: A DataFrame containing the feedback results. If no feedback results are found, an empty DataFrame is returned. |
highlight
¶
highlight(
row: Series,
selected_feedback: str,
feedback_directions: Dict[str, bool],
default_direction: str,
) -> List[str]
Apply background color to the rows of a DataFrame based on the selected feedback.
PARAMETER | DESCRIPTION |
---|---|
row
|
A row of the DataFrame to be highlighted.
TYPE:
|
selected_feedback
|
The selected feedback to determine the background color.
TYPE:
|
feedback_directions
|
A dictionary mapping feedback names to their directions.
TYPE:
|
default_direction
|
The default direction for feedback.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
list
|
A list of CSS styles representing the background color for each cell in the row. |