@@ -633,10 +633,11 @@ def render_metric_display_name(metric_display_name: Union[str, Tuple]):
633
633
class ResultCompareMixin :
634
634
def compare (self , other : Result ):
635
635
return ResultComparison (
636
- self , other , title = self ._get_title (other ), plot_kwargs = _get_plot_kwargs (self , other ) # type: ignore
636
+ self , other , title = self .get_title (other ), plot_kwargs = _get_plot_kwargs (self , other ) # type: ignore
637
637
)
638
638
639
- def _get_title (self , other : Result ):
639
+ @property
640
+ def titles (self ) -> Dict [type , str ]:
640
641
from nannyml .data_quality .missing .result import Result as MissingValueResult
641
642
from nannyml .data_quality .unseen .result import Result as UnseenValuesResult
642
643
from nannyml .drift .multivariate .data_reconstruction import Result as DataReconstructionDriftResult
@@ -649,7 +650,7 @@ def _get_title(self, other: Result):
649
650
from nannyml .stats .std import Result as StatsStdResult
650
651
from nannyml .stats .sum import Result as StatsSumResult
651
652
652
- _result_title_names : Dict [type , Any ] = {
653
+ _titles : Dict [type , Any ] = {
653
654
UnivariateDriftResult : "Univariate drift" ,
654
655
DataReconstructionDriftResult : "Multivariate drift" ,
655
656
RealizedPerformanceResult : "Realized performance" ,
@@ -663,7 +664,10 @@ def _get_title(self, other: Result):
663
664
StatsSumResult : "Statistics, Sum" ,
664
665
}
665
666
666
- return f"<b>{ _result_title_names [type (self )]} </b> vs. <b>{ _result_title_names [type (other )]} </b>"
667
+ return _titles
668
+
669
+ def get_title (self , other : Result ):
670
+ return f"<b>{ self .titles [type (self )]} </b> vs. <b>{ self .titles [type (other )]} </b>"
667
671
668
672
669
673
def _get_plot_kwargs (result : Result , other : Result ) -> Dict [str , Any ]:
0 commit comments