File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 5
5
import matplotlib .pyplot as plt
6
6
import matplotlib as mpl
7
7
import pandas as pd
8
- from pandas .io .formats .style import Styler # pylint: disable=unused-import
9
8
import uuid as _uuid
10
9
11
10
from trustyai import _default_initializer # pylint: disable=unused-import
20
19
Model ,
21
20
)
22
21
22
+ from .explanation_results import ExplanationResults
23
+
23
24
24
25
from trustyai .utils .data_conversions import (
25
26
prediction_object_to_numpy ,
50
51
CounterfactualConfig = _CounterfactualConfig
51
52
52
53
53
- class CounterfactualResult :
54
+ class CounterfactualResult ( ExplanationResults ) :
54
55
"""Wraps Counterfactual results. This object is returned by the
55
56
:class:`~CounterfactualExplainer`, and provides a variety of methods to visualize and interact
56
57
with the results of the counterfactual explanation.
Original file line number Diff line number Diff line change 8
8
from pandas .io .formats .style import Styler
9
9
10
10
11
+ # pylint: disable=too-few-public-methods
12
+ class ExplanationResults (ABC ):
13
+ """Abstract class for non-saliency visualisers"""
14
+
15
+ @abstractmethod
16
+ def as_dataframe (self ) -> pd .DataFrame :
17
+ """Display explanation result as a dataframe"""
18
+
19
+ @abstractmethod
20
+ def as_html (self ) -> Styler :
21
+ """Visualise the styled dataframe"""
22
+
23
+
11
24
# pylint: disable=too-few-public-methods
12
25
class SaliencyResults (ABC ):
13
26
"""Abstract class for saliency visualisers"""
You can’t perform that action at this time.
0 commit comments