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 55import  matplotlib .pyplot  as  plt 
66import  matplotlib  as  mpl 
77import  pandas  as  pd 
8- from  pandas .io .formats .style  import  Styler   # pylint: disable=unused-import 
98import  uuid  as  _uuid 
109
1110from  trustyai  import  _default_initializer   # pylint: disable=unused-import 
2019    Model ,
2120)
2221
22+ from  .explanation_results  import  ExplanationResults 
23+ 
2324
2425from  trustyai .utils .data_conversions  import  (
2526    prediction_object_to_numpy ,
5051CounterfactualConfig  =  _CounterfactualConfig 
5152
5253
53- class  CounterfactualResult :
54+ class  CounterfactualResult ( ExplanationResults ) :
5455    """Wraps Counterfactual results. This object is returned by the 
5556    :class:`~CounterfactualExplainer`, and provides a variety of methods to visualize and interact 
5657    with the results of the counterfactual explanation. 
Original file line number Diff line number Diff line change 88from  pandas .io .formats .style  import  Styler 
99
1010
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+ 
1124# pylint: disable=too-few-public-methods 
1225class  SaliencyResults (ABC ):
1326    """Abstract class for saliency visualisers""" 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments