Skip to content

Commit 29046b6

Browse files
committed
Minor update to Holo
1 parent 2c02fbc commit 29046b6

File tree

5 files changed

+20
-9
lines changed

5 files changed

+20
-9
lines changed

autoviz/AutoViz_Holo.py

+13-5
Original file line numberDiff line numberDiff line change
@@ -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[:]

autoviz/AutoViz_Utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,7 @@ def draw_distplot(dft, cat_bools, conti, verbose,chart_format,problem_type,dep=N
749749
width_size = 15 #### this is to control the width of chart as well as number of categories to display
750750
height_size = 5
751751
gap = 0.4 #### This controls the space between rows ######
752+
pdb.set_trace()
752753
if dep is None or dep=='' or problem_type == 'Regression':
753754
image_count = 0
754755
transparent = 0.7

autoviz/__init__.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
else:
1010
module_type = 'Imported'
1111
version_number = __version__
12-
print("""%s v%s. After importing autoviz, you must run '%%matplotlib inline' to display charts inline.
12+
print("""%s v%s. Please call AutoViz in this sequence:
1313
AV = AutoViz_Class()
14+
%%matplotlib inline
1415
dfte = AV.AutoViz(filename, sep=',', depVar='', dfte=None, header=0, verbose=1, lowess=False,
15-
chart_format='svg',max_rows_analyzed=150000,max_cols_analyzed=30, save_plot_dir=None)""" %(module_type, version_number))
16+
chart_format='svg',max_rows_analyzed=150000,max_cols_analyzed=30, save_plot_dir=None)""" %(
17+
module_type, version_number))
1618
###########################################################################################

autoviz/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
__author__ = "Ram Seshadri"
66
__description__ = "Automatically Visualize any data set any size with a Single Line of Code"
77
__url__ = "https://github.com/AutoViML/AutoViz.git"
8-
__version__ = "0.1.804"
8+
__version__ = "0.1.806"
99
__holo_version__ = "0.0.4"
1010
__license__ = "Apache License 2.0"
1111
__copyright__ = "2020-21 Google"

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="autoviz",
8-
version="0.1.804",
8+
version="0.1.805",
99
author="Ram Seshadri",
1010
# author_email="[email protected]",
1111
description="Automatically Visualize any dataset, any size with a single line of code",

0 commit comments

Comments
 (0)