11from ..utils import DataikuException
22from ..utils import DataikuUTF8CSVReader
33from ..utils import DataikuStreamedHttpUTF8CSVReader
4- from ..utils import DSSExtensibleDict
4+ from ..utils import DSSInternalDict
55import json
66import time
77from .metrics import ComputedMetrics
@@ -723,7 +723,7 @@ def get_partial_dependencies(self):
723723 return DSSPartialDependencies (data )
724724
725725
726- class DSSSubpopulationGlobal (DSSExtensibleDict ):
726+ class DSSSubpopulationGlobal (DSSInternalDict ):
727727 """
728728 Object to read details of performance on global population used for subpopulation analyses.
729729
@@ -738,7 +738,7 @@ def get_performance_metrics(self):
738738 """
739739 Gets the performance results of the global population used for the subpopulation analysis
740740 """
741- return self .get ("performanceMetrics" )
741+ return self ._internal_dict . get ("performanceMetrics" )
742742
743743 def get_prediction_info (self ):
744744 """
@@ -761,7 +761,7 @@ def get_prediction_info(self):
761761 }
762762
763763
764- class DSSSubpopulationModality (DSSExtensibleDict ):
764+ class DSSSubpopulationModality (DSSInternalDict ):
765765 """
766766 Object to read details of a subpopulation analysis modality
767767
@@ -781,7 +781,7 @@ def get_raw(self):
781781 """
782782 Gets the raw dictionary of the subpopulation analysis modality
783783 """
784- return self .internal_dict
784+ return self ._internal_dict
785785
786786 def get_definition (self ):
787787 """
@@ -890,7 +890,7 @@ def __repr__(self):
890890 return "DSSSubpopulationCategoryModalityDefinition(%s='%s')" % (self .feature_name , self .value )
891891
892892
893- class DSSSubpopulationAnalysis (DSSExtensibleDict ):
893+ class DSSSubpopulationAnalysis (DSSInternalDict ):
894894 """
895895 Object to read details of a subpopulation analysis of a trained model
896896
@@ -954,10 +954,10 @@ def get_raw(self):
954954 """
955955 Gets the raw dictionary of the subpopulation analysis
956956 """
957- return self .internal_dict
957+ return self ._internal_dict
958958
959959
960- class DSSSubpopulationAnalyses (DSSExtensibleDict ):
960+ class DSSSubpopulationAnalyses (DSSInternalDict ):
961961 """
962962 Object to read details of subpopulation analyses of a trained model
963963
@@ -975,7 +975,7 @@ def get_raw(self):
975975 """
976976 Gets the raw dictionary of subpopulation analyses
977977 """
978- return self .internal_dict
978+ return self ._internal_dict
979979
980980 def get_global (self ):
981981 """
@@ -987,19 +987,19 @@ def list_analyses(self):
987987 """
988988 Lists all features on which subpopulation analyses have been computed
989989 """
990- return [analysis [ "feature" ] for analysis in self .analyses ]
990+ return [analysis . get ( "feature" ) for analysis in self .analyses ]
991991
992992 def get_analysis (self , feature ):
993993 """
994994 Retrieves the subpopulation analysis for a particular feature
995995 """
996996 try :
997- return next (analysis for analysis in self .analyses if analysis [ "feature" ] == feature )
997+ return next (analysis for analysis in self .analyses if analysis . get ( "feature" ) == feature )
998998 except StopIteration :
999999 raise ValueError ("Subpopulation analysis for feature '%s' cannot be found" % feature )
10001000
10011001
1002- class DSSPartialDependence (DSSExtensibleDict ):
1002+ class DSSPartialDependence (DSSInternalDict ):
10031003 """
10041004 Object to read details of partial dependence of a trained model
10051005
@@ -1023,10 +1023,10 @@ def get_raw(self):
10231023 """
10241024 Gets the raw dictionary of the partial dependence
10251025 """
1026- return self .internal_dict
1026+ return self ._internal_dict
10271027
10281028
1029- class DSSPartialDependencies (DSSExtensibleDict ):
1029+ class DSSPartialDependencies (DSSInternalDict ):
10301030 """
10311031 Object to read details of partial dependencies of a trained model
10321032
@@ -1043,20 +1043,20 @@ def get_raw(self):
10431043 """
10441044 Gets the raw dictionary of partial dependencies
10451045 """
1046- return self .internal_dict
1046+ return self ._internal_dict
10471047
10481048 def list_features (self ):
10491049 """
10501050 Lists all features on which partial dependencies have been computed
10511051 """
1052- return [partial_dep [ "feature" ] for partial_dep in self .partial_dependencies ]
1052+ return [partial_dep . get ( "feature" ) for partial_dep in self .partial_dependencies ]
10531053
10541054 def get_partial_dependence (self , feature ):
10551055 """
10561056 Retrieves the partial dependencies for a particular feature
10571057 """
10581058 try :
1059- return next (pd for pd in self .partial_dependencies if pd [ "feature" ] == feature )
1059+ return next (pd for pd in self .partial_dependencies if pd . get ( "feature" ) == feature )
10601060 except StopIteration :
10611061 raise ValueError ("Partial dependence for feature '%s' cannot be found" % feature )
10621062
0 commit comments