@@ -225,7 +225,12 @@ def AutoViz_Holo(filename, sep=',', depVar='', dfte=None, header=0, verbose=0,
225
225
drawobj5 = draw_violinplot_hv (dfin , dep , nums , chart_format , problem_type , mk_dir , verbose )
226
226
ls_objects .append (drawobj5 )
227
227
if len (nums ) > 0 :
228
- drawobj6 = draw_heatmap_hv (dfin , nums , chart_format , date_vars , dep , problem_type , classes ,
228
+ #### Adding int vars to nums since pandas has changed the df.corr() to error when cats are included ###
229
+ if len (cats ) > 0 :
230
+ nums_in = nums + dfin [cats ].select_dtypes (include = "number" ).columns .tolist ()
231
+ else :
232
+ nums_in = nums [:]
233
+ drawobj6 = draw_heatmap_hv (dfin , nums_in , chart_format , date_vars , dep , problem_type , classes ,
229
234
mk_dir , verbose )
230
235
ls_objects .append (drawobj6 )
231
236
if len (date_vars ) > 0 :
@@ -1035,7 +1040,7 @@ def create_figure(x, y):
1035
1040
opts ['alpha' ] = alpha
1036
1041
opts ['tools' ] = ['hover' ]
1037
1042
opts ['toolbar' ] = 'above'
1038
- opts ['colorbar' ] = True
1043
+ # opts['colorbar'] = True
1039
1044
#opts['color'] = next(colors)
1040
1045
opts ['title' ] = title = 'Time Series plots of Numeric vars'
1041
1046
dft = df .set_index (df [x ])
@@ -1115,15 +1120,16 @@ def draw_heatmap_hv(dft, conti, chart_format, datevars=[], dep=None,
1115
1120
dft_target = dft [conti ]
1116
1121
dft_target [dep ] = dft [dep ].values
1117
1122
corre = dft_target .corr ()
1123
+ corre = corre .round (2 )
1118
1124
if timeseries_flag :
1119
1125
heatmap = corre .hvplot .heatmap (height = height_size , width = width_size , colorbar = True ,
1120
1126
cmap = cmap_list , rot = 70 ,
1121
- title = 'Time Series: Heatmap of all Differenced Continuous vars for target = %s' % dep )
1127
+ title = 'Time Series: Heatmap of all Differenced Numeric vars for target = %s' % dep )
1122
1128
else :
1123
1129
heatmap = corre .hvplot .heatmap (height = height_size , width = width_size , colorbar = True ,
1124
1130
cmap = cmap_list ,
1125
1131
rot = 70 ,
1126
- title = 'Heatmap of all Continuous Variables including target' );
1132
+ title = 'Heatmap of all Numeric Variables including target' );
1127
1133
hv_plot = heatmap * hv .Labels (heatmap ).opts (opts .Labels (text_font_size = '7pt' ))
1128
1134
hv_panel = pn .panel (hv_plot )
1129
1135
if verbose == 2 :
@@ -1143,17 +1149,18 @@ def draw_heatmap_hv(dft, conti, chart_format, datevars=[], dep=None,
1143
1149
dft_target = dft_target [:]
1144
1150
N = len (conti )
1145
1151
corre = dft_target .corr ()
1152
+ corre = corre .round (2 )
1146
1153
if timeseries_flag :
1147
1154
heatmap = corre .hvplot .heatmap (height = height_size , width = width_size , colorbar = True ,
1148
1155
cmap = cmap_list ,
1149
1156
rot = 70 ,
1150
- title = 'Time Series Data: Heatmap of Differenced Continuous vars including target' ).opts (
1157
+ title = 'Time Series Data: Heatmap of Differenced Numeric vars including target' ).opts (
1151
1158
opts .HeatMap (tools = ['hover' ], toolbar = 'above' ))
1152
1159
else :
1153
1160
heatmap = corre .hvplot .heatmap (height = height_size , width = width_size , colorbar = True ,
1154
1161
cmap = cmap_list ,
1155
1162
rot = 70 ,
1156
- title = 'Heatmap of all Continuous Variables including target' ).opts (
1163
+ title = 'Heatmap of all Numeric Variables including target' ).opts (
1157
1164
opts .HeatMap (tools = ['hover' ], toolbar = 'above' ))
1158
1165
hv_plot = heatmap * hv .Labels (heatmap ).opts (opts .Labels (text_font_size = '7pt' ))
1159
1166
hv_panel = pn .panel (hv_plot )
0 commit comments