Skip to content

Commit

Permalink
Minor update to Holo
Browse files Browse the repository at this point in the history
  • Loading branch information
AutoViML committed Feb 14, 2024
1 parent 2c02fbc commit 29046b6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
18 changes: 13 additions & 5 deletions autoviz/AutoViz_Holo.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ def draw_cat_vars_hv(dfin, dep, nums, cats, chart_format, problem_type, mk_dir,
colortext = 'brycgkbyrcmgkbyrcmgkbyrcmgkbyr'
colors = cycle('brycgkbyrcmgkbyrcmgkbyrcmgkbyr')
plot_name = 'cat_var_plots'
hv_panel = None
#####################################################
if problem_type == 'Clustering':
### There is no depVar in clustering, so no need to add it to None
Expand Down Expand Up @@ -281,7 +282,7 @@ def draw_cat_vars_hv(dfin, dep, nums, cats, chart_format, problem_type, mk_dir,
@pn.depends(x.param.value, y.param.value)
def create_figure(x, y):
#opts = dict(cmap=cmap_list[0], line_color='black')
opts = dict(cmap=cmap_list[0], width=width_size, height=height_size, line_color='black',
opts = dict(width=width_size, height=height_size, line_color='black',
xrotation=70, title='Average of each numeric var by categorical var')
### If it is None, don't stack it
opts['color'] = next(colors)
Expand Down Expand Up @@ -320,7 +321,7 @@ def draw_kdeplot_hv(dfin, cats, nums, chart_format, problem_type, dep, ls_object
plot_name = 'kde_plots'
width_size = 600
height_size = 400

hv_all = None
########################################################################################
def return_dynamic_objects(dfout, dep, title='Distribution of Target variable'):
width_size = 600
Expand All @@ -338,7 +339,7 @@ def return_dynamic_objects(dfout, dep, title='Distribution of Target variable'):
).opts(shared_axes=False).opts(title='Histogram and KDE of Target = %s' %dep)).opts(
height=height_size, width=width_size)
dmap.opts(framewise=True,axiswise=True) ## both must be True for your charts to have dynamically varying axes!
hv_all = pn.pane.HoloViews(dmap)#, sizing_mode="stretch_both")
hv_all = pn.panel.HoloViews(dmap)#, sizing_mode="stretch_both")
#ls_objects.append(drawobj41)
#ls_objects.append(drawobj42)
else:
Expand All @@ -350,7 +351,7 @@ def return_dynamic_objects(dfout, dep, title='Distribution of Target variable'):
else:
dmap = hv.DynamicMap(return_dynamic_objects(dfin, dep, title=f'Histogram and KDE of Target = {dep}')).opts(width=width_size)
dmap.opts(framewise=True,axiswise=True) ## both must be True for your charts to have dynamically varying axes!
hv_all = pn.pane.HoloViews(dmap)
hv_all = pn.panel.HoloViews(dmap)
#ls_objects.append(drawobj41)
#ls_objects.append(drawobj42)
#### In this case we are using multiple objects in panel ###
Expand Down Expand Up @@ -390,6 +391,8 @@ def draw_scatters_hv(dft, nums, chart_format, problem_type,
colors = cycle('brycgkbyrcmgkbyrcmgkbyrcmgkbyr')
cmap_list = ['rainbow', 'viridis', 'plasma', 'inferno', 'magma', 'cividis']
plot_name = 'scatterplots'
hv_all = None
hv_panel = None
#####################################################
if problem_type == 'Regression':
####### This is a Regression Problem #### You need to plot a Scatter plot ####
Expand Down Expand Up @@ -513,6 +516,7 @@ def draw_pair_scatters_hv(dfin,nums,problem_type,chart_format, dep=None,
cmap_list = ['rainbow', 'viridis', 'plasma', 'inferno', 'magma', 'cividis']
plot_name = 'pair_scatters'
colors = cycle('brycgkbyrcmgkbyrcmgkbyrcmgkbyr')
hv_panel = None
###########################################################################
if problem_type in ['Regression', 'Clustering']:
########## This is for Regression problems ##########
Expand Down Expand Up @@ -653,6 +657,7 @@ def draw_distplot_hv(dft, cats, conti, chart_format,problem_type,dep=None,
height_size = 400
gap = 0.4 #### This controls the space between rows ######
plot_name = 'distplots'
hv_all = None
###################################################################################
if dep==None or dep=='' or problem_type == 'Regression':
######### This is for Regression problems only ########
Expand Down Expand Up @@ -857,6 +862,7 @@ def draw_violinplot_hv(dft, dep, nums,chart_format, modeltype='Regression',
nums = [x for x in nums if x not in dep]
colors = cycle('brycgkbyrcmgkbyrcmgkbyrcmgkbyr')
plot_name = 'violinplots'
hv_all = None
#############################################################################
if modeltype in ['Regression', 'Clustering']:
### This is for Regression and None Dep variable problems only ##
Expand Down Expand Up @@ -990,6 +996,7 @@ def draw_date_vars_hv(df,dep,datevars, nums, chart_format, modeltype='Regression
colortext = 'brycgkbyrcmgkbyrcmgkbyrcmgkbyr'
colors = cycle('brycgkbyrcmgkbyrcmgkbyrcmgkbyr')
plot_name = 'timeseries_plots'
hv_panel = None
#####################################################
###### Draw the time series for Regression and DepVar
#####################################################
Expand All @@ -1013,7 +1020,7 @@ def draw_date_vars_hv(df,dep,datevars, nums, chart_format, modeltype='Regression
@pn.depends(x.param.value, y.param.value)
def create_figure(x, y):
#opts = dict(cmap=cmap_list[0], line_color='black')
opts = dict(cmap=cmap_list[0], width=width_size, height=height_size,
opts = dict(width=width_size, height=height_size,
line_color='black',
line_width=1, line_dash='dotted', line_alpha=0.5)
#opts['size'] = bubble_size
Expand Down Expand Up @@ -1063,6 +1070,7 @@ def draw_heatmap_hv(dft, conti, chart_format, datevars=[], dep=None,
height_size = 800
width_size = 1200
plot_name = 'heatmaps'
hv_panel = None
##### If it is a datetime index we need to calculate heat map on differenced data ###
if isinstance(dft.index, pd.DatetimeIndex) :
dft = dft[:]
Expand Down
1 change: 1 addition & 0 deletions autoviz/AutoViz_Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,7 @@ def draw_distplot(dft, cat_bools, conti, verbose,chart_format,problem_type,dep=N
width_size = 15 #### this is to control the width of chart as well as number of categories to display
height_size = 5
gap = 0.4 #### This controls the space between rows ######
pdb.set_trace()
if dep is None or dep=='' or problem_type == 'Regression':
image_count = 0
transparent = 0.7
Expand Down
6 changes: 4 additions & 2 deletions autoviz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
else:
module_type = 'Imported'
version_number = __version__
print("""%s v%s. After importing autoviz, you must run '%%matplotlib inline' to display charts inline.
print("""%s v%s. Please call AutoViz in this sequence:
AV = AutoViz_Class()
%%matplotlib inline
dfte = AV.AutoViz(filename, sep=',', depVar='', dfte=None, header=0, verbose=1, lowess=False,
chart_format='svg',max_rows_analyzed=150000,max_cols_analyzed=30, save_plot_dir=None)""" %(module_type, version_number))
chart_format='svg',max_rows_analyzed=150000,max_cols_analyzed=30, save_plot_dir=None)""" %(
module_type, version_number))
###########################################################################################
2 changes: 1 addition & 1 deletion autoviz/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
__author__ = "Ram Seshadri"
__description__ = "Automatically Visualize any data set any size with a Single Line of Code"
__url__ = "https://github.com/AutoViML/AutoViz.git"
__version__ = "0.1.804"
__version__ = "0.1.806"
__holo_version__ = "0.0.4"
__license__ = "Apache License 2.0"
__copyright__ = "2020-21 Google"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="autoviz",
version="0.1.804",
version="0.1.805",
author="Ram Seshadri",
# author_email="author@example.com",
description="Automatically Visualize any dataset, any size with a single line of code",
Expand Down

0 comments on commit 29046b6

Please sign in to comment.