@@ -274,11 +274,11 @@ def scatter(shap_values, color="#1E88E5", hist=True, axis_color="#333333", cmap=
274274 interaction_feature_values = encode_array_if_needed (features [:, interaction_index ])
275275 cv = interaction_feature_values
276276 cd = display_features [:, interaction_index ]
277- clow = np .nanpercentile (cv .astype (np . float ), 5 )
278- chigh = np .nanpercentile (cv .astype (np . float ), 95 )
277+ clow = np .nanpercentile (cv .astype (float ), 5 )
278+ chigh = np .nanpercentile (cv .astype (float ), 95 )
279279 if clow == chigh :
280- clow = np .nanmin (cv .astype (np . float ))
281- chigh = np .nanmax (cv .astype (np . float ))
280+ clow = np .nanmin (cv .astype (float ))
281+ chigh = np .nanmax (cv .astype (float ))
282282 if type (cd [0 ]) == str :
283283 cname_map = {}
284284 for i in range (len (cv )):
@@ -290,8 +290,8 @@ def scatter(shap_values, color="#1E88E5", hist=True, axis_color="#333333", cmap=
290290
291291 # discritize colors for categorical features
292292 if categorical_interaction and clow != chigh :
293- clow = np .nanmin (cv .astype (np . float ))
294- chigh = np .nanmax (cv .astype (np . float ))
293+ clow = np .nanmin (cv .astype (float ))
294+ chigh = np .nanmax (cv .astype (float ))
295295 bounds = np .linspace (clow , chigh , min (int (chigh - clow + 2 ), cmap .N - 1 ))
296296 color_norm = matplotlib .colors .BoundaryNorm (bounds , cmap .N - 1 )
297297
@@ -301,7 +301,7 @@ def scatter(shap_values, color="#1E88E5", hist=True, axis_color="#333333", cmap=
301301 if x_jitter > 1 : x_jitter = 1
302302 xvals = xv .copy ()
303303 if isinstance (xvals [0 ], float ):
304- xvals = xvals .astype (np . float )
304+ xvals = xvals .astype (float )
305305 xvals = xvals [~ np .isnan (xvals )]
306306 xvals = np .unique (xvals ) # returns a sorted array
307307 if len (xvals ) >= 2 :
@@ -628,11 +628,11 @@ def dependence_legacy(ind, shap_values=None, features=None, feature_names=None,
628628 interaction_feature_values = encode_array_if_needed (features [:, interaction_index ])
629629 cv = interaction_feature_values
630630 cd = display_features [:, interaction_index ]
631- clow = np .nanpercentile (cv .astype (np . float ), 5 )
632- chigh = np .nanpercentile (cv .astype (np . float ), 95 )
631+ clow = np .nanpercentile (cv .astype (float ), 5 )
632+ chigh = np .nanpercentile (cv .astype (float ), 95 )
633633 if clow == chigh :
634- clow = np .nanmin (cv .astype (np . float ))
635- chigh = np .nanmax (cv .astype (np . float ))
634+ clow = np .nanmin (cv .astype (float ))
635+ chigh = np .nanmax (cv .astype (float ))
636636 if type (cd [0 ]) == str :
637637 cname_map = {}
638638 for i in range (len (cv )):
@@ -644,8 +644,8 @@ def dependence_legacy(ind, shap_values=None, features=None, feature_names=None,
644644
645645 # discritize colors for categorical features
646646 if categorical_interaction and clow != chigh :
647- clow = np .nanmin (cv .astype (np . float ))
648- chigh = np .nanmax (cv .astype (np . float ))
647+ clow = np .nanmin (cv .astype (float ))
648+ chigh = np .nanmax (cv .astype (float ))
649649 bounds = np .linspace (clow , chigh , min (int (chigh - clow + 2 ), cmap .N - 1 ))
650650 color_norm = matplotlib .colors .BoundaryNorm (bounds , cmap .N - 1 )
651651
@@ -654,7 +654,7 @@ def dependence_legacy(ind, shap_values=None, features=None, feature_names=None,
654654 if x_jitter > 1 : x_jitter = 1
655655 xvals = xv .copy ()
656656 if isinstance (xvals [0 ], float ):
657- xvals = xvals .astype (np . float )
657+ xvals = xvals .astype (float )
658658 xvals = xvals [~ np .isnan (xvals )]
659659 xvals = np .unique (xvals ) # returns a sorted array
660660 if len (xvals ) >= 2 :
0 commit comments