@@ -251,6 +251,7 @@ def draw_cat_vars_hv(dfin, dep, nums, cats, chart_format, problem_type, mk_dir,
251
251
colortext = 'brycgkbyrcmgkbyrcmgkbyrcmgkbyr'
252
252
colors = cycle ('brycgkbyrcmgkbyrcmgkbyrcmgkbyr' )
253
253
plot_name = 'cat_var_plots'
254
+ hv_panel = None
254
255
#####################################################
255
256
if problem_type == 'Clustering' :
256
257
### There is no depVar in clustering, so no need to add it to None
@@ -281,7 +282,7 @@ def draw_cat_vars_hv(dfin, dep, nums, cats, chart_format, problem_type, mk_dir,
281
282
@pn .depends (x .param .value , y .param .value )
282
283
def create_figure (x , y ):
283
284
#opts = dict(cmap=cmap_list[0], line_color='black')
284
- opts = dict (cmap = cmap_list [ 0 ], width = width_size , height = height_size , line_color = 'black' ,
285
+ opts = dict (width = width_size , height = height_size , line_color = 'black' ,
285
286
xrotation = 70 , title = 'Average of each numeric var by categorical var' )
286
287
### If it is None, don't stack it
287
288
opts ['color' ] = next (colors )
@@ -320,7 +321,7 @@ def draw_kdeplot_hv(dfin, cats, nums, chart_format, problem_type, dep, ls_object
320
321
plot_name = 'kde_plots'
321
322
width_size = 600
322
323
height_size = 400
323
-
324
+ hv_all = None
324
325
########################################################################################
325
326
def return_dynamic_objects (dfout , dep , title = 'Distribution of Target variable' ):
326
327
width_size = 600
@@ -338,7 +339,7 @@ def return_dynamic_objects(dfout, dep, title='Distribution of Target variable'):
338
339
).opts (shared_axes = False ).opts (title = 'Histogram and KDE of Target = %s' % dep )).opts (
339
340
height = height_size , width = width_size )
340
341
dmap .opts (framewise = True ,axiswise = True ) ## both must be True for your charts to have dynamically varying axes!
341
- hv_all = pn .pane .HoloViews (dmap )#, sizing_mode="stretch_both")
342
+ hv_all = pn .panel .HoloViews (dmap )#, sizing_mode="stretch_both")
342
343
#ls_objects.append(drawobj41)
343
344
#ls_objects.append(drawobj42)
344
345
else :
@@ -350,7 +351,7 @@ def return_dynamic_objects(dfout, dep, title='Distribution of Target variable'):
350
351
else :
351
352
dmap = hv .DynamicMap (return_dynamic_objects (dfin , dep , title = f'Histogram and KDE of Target = { dep } ' )).opts (width = width_size )
352
353
dmap .opts (framewise = True ,axiswise = True ) ## both must be True for your charts to have dynamically varying axes!
353
- hv_all = pn .pane .HoloViews (dmap )
354
+ hv_all = pn .panel .HoloViews (dmap )
354
355
#ls_objects.append(drawobj41)
355
356
#ls_objects.append(drawobj42)
356
357
#### In this case we are using multiple objects in panel ###
@@ -390,6 +391,8 @@ def draw_scatters_hv(dft, nums, chart_format, problem_type,
390
391
colors = cycle ('brycgkbyrcmgkbyrcmgkbyrcmgkbyr' )
391
392
cmap_list = ['rainbow' , 'viridis' , 'plasma' , 'inferno' , 'magma' , 'cividis' ]
392
393
plot_name = 'scatterplots'
394
+ hv_all = None
395
+ hv_panel = None
393
396
#####################################################
394
397
if problem_type == 'Regression' :
395
398
####### This is a Regression Problem #### You need to plot a Scatter plot ####
@@ -513,6 +516,7 @@ def draw_pair_scatters_hv(dfin,nums,problem_type,chart_format, dep=None,
513
516
cmap_list = ['rainbow' , 'viridis' , 'plasma' , 'inferno' , 'magma' , 'cividis' ]
514
517
plot_name = 'pair_scatters'
515
518
colors = cycle ('brycgkbyrcmgkbyrcmgkbyrcmgkbyr' )
519
+ hv_panel = None
516
520
###########################################################################
517
521
if problem_type in ['Regression' , 'Clustering' ]:
518
522
########## This is for Regression problems ##########
@@ -653,6 +657,7 @@ def draw_distplot_hv(dft, cats, conti, chart_format,problem_type,dep=None,
653
657
height_size = 400
654
658
gap = 0.4 #### This controls the space between rows ######
655
659
plot_name = 'distplots'
660
+ hv_all = None
656
661
###################################################################################
657
662
if dep == None or dep == '' or problem_type == 'Regression' :
658
663
######### This is for Regression problems only ########
@@ -857,6 +862,7 @@ def draw_violinplot_hv(dft, dep, nums,chart_format, modeltype='Regression',
857
862
nums = [x for x in nums if x not in dep ]
858
863
colors = cycle ('brycgkbyrcmgkbyrcmgkbyrcmgkbyr' )
859
864
plot_name = 'violinplots'
865
+ hv_all = None
860
866
#############################################################################
861
867
if modeltype in ['Regression' , 'Clustering' ]:
862
868
### This is for Regression and None Dep variable problems only ##
@@ -990,6 +996,7 @@ def draw_date_vars_hv(df,dep,datevars, nums, chart_format, modeltype='Regression
990
996
colortext = 'brycgkbyrcmgkbyrcmgkbyrcmgkbyr'
991
997
colors = cycle ('brycgkbyrcmgkbyrcmgkbyrcmgkbyr' )
992
998
plot_name = 'timeseries_plots'
999
+ hv_panel = None
993
1000
#####################################################
994
1001
###### Draw the time series for Regression and DepVar
995
1002
#####################################################
@@ -1013,7 +1020,7 @@ def draw_date_vars_hv(df,dep,datevars, nums, chart_format, modeltype='Regression
1013
1020
@pn .depends (x .param .value , y .param .value )
1014
1021
def create_figure (x , y ):
1015
1022
#opts = dict(cmap=cmap_list[0], line_color='black')
1016
- opts = dict (cmap = cmap_list [ 0 ], width = width_size , height = height_size ,
1023
+ opts = dict (width = width_size , height = height_size ,
1017
1024
line_color = 'black' ,
1018
1025
line_width = 1 , line_dash = 'dotted' , line_alpha = 0.5 )
1019
1026
#opts['size'] = bubble_size
@@ -1063,6 +1070,7 @@ def draw_heatmap_hv(dft, conti, chart_format, datevars=[], dep=None,
1063
1070
height_size = 800
1064
1071
width_size = 1200
1065
1072
plot_name = 'heatmaps'
1073
+ hv_panel = None
1066
1074
##### If it is a datetime index we need to calculate heat map on differenced data ###
1067
1075
if isinstance (dft .index , pd .DatetimeIndex ) :
1068
1076
dft = dft [:]
0 commit comments