@@ -251,6 +251,7 @@ def draw_cat_vars_hv(dfin, dep, nums, cats, chart_format, problem_type, mk_dir,
251251 colortext = 'brycgkbyrcmgkbyrcmgkbyrcmgkbyr'
252252 colors = cycle ('brycgkbyrcmgkbyrcmgkbyrcmgkbyr' )
253253 plot_name = 'cat_var_plots'
254+ hv_panel = None
254255 #####################################################
255256 if problem_type == 'Clustering' :
256257 ### 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,
281282 @pn .depends (x .param .value , y .param .value )
282283 def create_figure (x , y ):
283284 #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' ,
285286 xrotation = 70 , title = 'Average of each numeric var by categorical var' )
286287 ### If it is None, don't stack it
287288 opts ['color' ] = next (colors )
@@ -320,7 +321,7 @@ def draw_kdeplot_hv(dfin, cats, nums, chart_format, problem_type, dep, ls_object
320321 plot_name = 'kde_plots'
321322 width_size = 600
322323 height_size = 400
323-
324+ hv_all = None
324325 ########################################################################################
325326 def return_dynamic_objects (dfout , dep , title = 'Distribution of Target variable' ):
326327 width_size = 600
@@ -338,7 +339,7 @@ def return_dynamic_objects(dfout, dep, title='Distribution of Target variable'):
338339 ).opts (shared_axes = False ).opts (title = 'Histogram and KDE of Target = %s' % dep )).opts (
339340 height = height_size , width = width_size )
340341 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")
342343 #ls_objects.append(drawobj41)
343344 #ls_objects.append(drawobj42)
344345 else :
@@ -350,7 +351,7 @@ def return_dynamic_objects(dfout, dep, title='Distribution of Target variable'):
350351 else :
351352 dmap = hv .DynamicMap (return_dynamic_objects (dfin , dep , title = f'Histogram and KDE of Target = { dep } ' )).opts (width = width_size )
352353 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 )
354355 #ls_objects.append(drawobj41)
355356 #ls_objects.append(drawobj42)
356357 #### In this case we are using multiple objects in panel ###
@@ -390,6 +391,8 @@ def draw_scatters_hv(dft, nums, chart_format, problem_type,
390391 colors = cycle ('brycgkbyrcmgkbyrcmgkbyrcmgkbyr' )
391392 cmap_list = ['rainbow' , 'viridis' , 'plasma' , 'inferno' , 'magma' , 'cividis' ]
392393 plot_name = 'scatterplots'
394+ hv_all = None
395+ hv_panel = None
393396 #####################################################
394397 if problem_type == 'Regression' :
395398 ####### 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,
513516 cmap_list = ['rainbow' , 'viridis' , 'plasma' , 'inferno' , 'magma' , 'cividis' ]
514517 plot_name = 'pair_scatters'
515518 colors = cycle ('brycgkbyrcmgkbyrcmgkbyrcmgkbyr' )
519+ hv_panel = None
516520 ###########################################################################
517521 if problem_type in ['Regression' , 'Clustering' ]:
518522 ########## This is for Regression problems ##########
@@ -653,6 +657,7 @@ def draw_distplot_hv(dft, cats, conti, chart_format,problem_type,dep=None,
653657 height_size = 400
654658 gap = 0.4 #### This controls the space between rows ######
655659 plot_name = 'distplots'
660+ hv_all = None
656661 ###################################################################################
657662 if dep == None or dep == '' or problem_type == 'Regression' :
658663 ######### This is for Regression problems only ########
@@ -857,6 +862,7 @@ def draw_violinplot_hv(dft, dep, nums,chart_format, modeltype='Regression',
857862 nums = [x for x in nums if x not in dep ]
858863 colors = cycle ('brycgkbyrcmgkbyrcmgkbyrcmgkbyr' )
859864 plot_name = 'violinplots'
865+ hv_all = None
860866 #############################################################################
861867 if modeltype in ['Regression' , 'Clustering' ]:
862868 ### 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
990996 colortext = 'brycgkbyrcmgkbyrcmgkbyrcmgkbyr'
991997 colors = cycle ('brycgkbyrcmgkbyrcmgkbyrcmgkbyr' )
992998 plot_name = 'timeseries_plots'
999+ hv_panel = None
9931000 #####################################################
9941001 ###### Draw the time series for Regression and DepVar
9951002 #####################################################
@@ -1013,7 +1020,7 @@ def draw_date_vars_hv(df,dep,datevars, nums, chart_format, modeltype='Regression
10131020 @pn .depends (x .param .value , y .param .value )
10141021 def create_figure (x , y ):
10151022 #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 ,
10171024 line_color = 'black' ,
10181025 line_width = 1 , line_dash = 'dotted' , line_alpha = 0.5 )
10191026 #opts['size'] = bubble_size
@@ -1063,6 +1070,7 @@ def draw_heatmap_hv(dft, conti, chart_format, datevars=[], dep=None,
10631070 height_size = 800
10641071 width_size = 1200
10651072 plot_name = 'heatmaps'
1073+ hv_panel = None
10661074 ##### If it is a datetime index we need to calculate heat map on differenced data ###
10671075 if isinstance (dft .index , pd .DatetimeIndex ) :
10681076 dft = dft [:]
0 commit comments