AutoViML / AutoViz

Automatically Visualize any dataset, any size with a single line of code. Created by Ram Seshadri. Collaborators Welcome. Permission Granted upon Request.
Apache License 2.0
1.7k stars 196 forks source link

ValueError #101

Closed DirtyStreetCoder closed 8 months ago

DirtyStreetCoder commented 9 months ago

Hi,

stumbled upon autoviz and failed to run even a minimal example.

1) Had to change 'seaborn' to 'seaborn-v0_8' in AutoViz_Class.py and AutoViz_Utils.py 2) After that i got the error below, where i don't know how to proceed

Any suggestions or fixes?

Thanks in advance.

FYI: Here i used python 3.11.6. Had the same Error in python 3.11.4. Could not even install autoviz in python 3.12

`--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[10], line 2 1 import pandas as pd ----> 2 from autoviz.AutoViz_Class import AutoViz_Class 4 get_ipython().run_line_magic('matplotlib', 'inline')

File ~\AppData\Roaming\Python\Python311\site-packages\autoviz__init.py:3 1 name = "autoviz" 2 from .version import version, holo_version__ ----> 3 from .AutoViz_Class import AutoViz_Class 4 from .AutoViz_Class import data_cleaning_suggestions 5 from .AutoViz_Class import FixDQ

File ~\AppData\Roaming\Python\Python311\site-packages\autoviz\AutoViz_Class.py:61 59 from sklearn.model_selection import train_test_split 60 ########################################################################################## ---> 61 from autoviz.AutoViz_Holo import AutoViz_Holo 62 from autoviz.AutoViz_Utils import save_image_data, save_html_data, analyze_problem_type, draw_pivot_tables, draw_scatters 63 from autoviz.AutoViz_Utils import draw_pair_scatters, plot_fast_average_num_by_cat, draw_barplots, draw_heatmap

File ~\AppData\Roaming\Python\Python311\site-packages\autoviz\AutoViz_Holo.py:5 3 import pandas as pd 4 ############# Import from autoviz.AutoViz_Class the following libraries ####### ----> 5 from autoviz.AutoViz_Utils import * 6 ############## make sure you use: conda install -c pyviz hvplot ############### 7 import hvplot.pandas # noqa

File ~\AppData\Roaming\Python\Python311\site-packages\autoviz\AutoViz_Utils.py:61 59 from sklearn.model_selection import train_test_split 60 ######## This is where we import HoloViews related libraries ######### ---> 61 import hvplot.pandas 62 import holoviews as hv 63 from holoviews import opts

File ~\AppData\Roaming\Python\Python311\site-packages\hvplot__init__.py:12 8 import holoviews as _hv 10 from holoviews import Store ---> 12 from .converter import HoloViewsConverter 13 from .util import get_ipy 14 from .utilities import save, show # noqa

File ~\AppData\Roaming\Python\Python311\site-packages\hvplot\converter.py:25 18 from holoviews.core.util import max_range, basestring 19 from holoviews.element import ( 20 Curve, Scatter, Area, Bars, BoxWhisker, Dataset, Distribution, 21 Table, HeatMap, Image, HexTiles, QuadMesh, Bivariate, Histogram, 22 Violin, Contours, Polygons, Points, Path, Labels, RGB, ErrorBars, 23 VectorField, Rectangles, Segments 24 ) ---> 25 from holoviews.plotting.bokeh import OverlayPlot, colormap_generator 26 from holoviews.plotting.util import process_cmap 27 from holoviews.operation import histogram

File ~\AppData\Roaming\Python\Python311\site-packages\holoviews\plotting\bokeh__init__.py:40 38 from .graphs import GraphPlot, NodePlot, TriMeshPlot, ChordPlot 39 from .heatmap import HeatMapPlot, RadialHeatMapPlot ---> 40 from .hex_tiles import HexTilesPlot 41 from .path import PathPlot, PolygonPlot, ContourPlot 42 from .plot import GridPlot, LayoutPlot, AdjointLayoutPlot

File ~\AppData\Roaming\Python\Python311\site-packages\holoviews\plotting\bokeh\hex_tiles.py:22 18 from .selection import BokehOverlaySelectionDisplay 19 from .styles import base_properties, line_properties, fill_properties ---> 22 class hexbinning(Operation): 23 """ 24 Applies hex binning by computing aggregates on a hexagonal grid. 25 26 Should not be user facing as the returned element is not directly 27 useable. 28 """ 30 aggregator = param.ClassSelector( 31 default=np.size, class=(types.FunctionType, tuple), doc=""" 32 Aggregation function or dimension transform used to compute bin 33 values. Defaults to np.size to count the number of values 34 in each bin.""")

File ~\AppData\Roaming\Python\Python311\site-packages\holoviews\plotting\bokeh\hex_tiles.py:30, in hex_binning() 22 class hexbinning(Operation): 23 """ 24 Applies hex binning by computing aggregates on a hexagonal grid. 25 26 Should not be user facing as the returned element is not directly 27 useable. 28 """ ---> 30 aggregator = param.ClassSelector( 31 default=np.size, class=(types.FunctionType, tuple), doc=""" 32 Aggregation function or dimension transform used to compute bin 33 values. Defaults to np.size to count the number of values 34 in each bin.""") 36 gridsize = param.ClassSelector(default=50, class_=(int, tuple)) 38 invert_axes = param.Boolean(default=False)

File ~\AppData\Roaming\Python\Python311\site-packages\param__init.py:1367, in ClassSelector.init(self, class_, default, instantiate, is_instance, **params) 1365 self.is_instance = is_instance 1366 super(ClassSelector,self).init__(default=default,instantiate=instantiate,**params) -> 1367 self._validate(default)

File ~\AppData\Roaming\Python\Python311\site-packages\param__init__.py:1371, in ClassSelector._validate(self, val) 1369 def _validate(self, val): 1370 super(ClassSelector, self)._validate(val) -> 1371 self._validateclass(val, self.class_, self.is_instance)

File ~\AppData\Roaming\Python\Python311\site-packages\param__init__.py:1383, in ClassSelector._validateclass(self, val, class_, is_instance) 1381 if isinstance: 1382 if not (isinstance(val, class)): -> 1383 raise ValueError( 1384 "%s parameter %r value must be an instance of %s, not %r." % 1385 (param_cls, self.name, classname, val)) 1386 else: 1387 if not (issubclass(val, class)):

ValueError: ClassSelector parameter None value must be an instance of (function, tuple), not <function size at 0x0000019E7F3B3DF0>.`

ConsciousML commented 9 months ago

I have the same issue with Python 3.10 but it works with 3.7

AutoViML commented 9 months ago

Ok @ConsciousML @DirtyStreetCoder : Let me see whether I can upgrade AutoViz to Python 3.10 version. I'll also have to check if importing hvplot and pyviz can be made within function calls so I can remove their versions from requirements.txt and setup.py files. It seems like hvplot and pyviz are changing too much for me to hold AutoViz to a consistent version. Give me a few days. Auto Vimal

AutoViML commented 8 months ago

Hey @ConsciousML @DirtyStreetCoder : I have some Good News! I have removed some references to Seaborn styles which have been deprecated. That seems to have fixed some issues. Can you please upgrade your AutoViz version to the latest version (0.1.735) and let me know whether your issues are fixed? Thanks Auto Vimal

AutoViML commented 8 months ago

Hi @DirtyStreetCoder @ConsciousML 👍 I have finally found the dependency problems with Python 3.10+ and fixed them I think. I have a new version 0.1.801 of AutoViz - please pip install and try it 👍 Thanks for your patience, Auto Vimal

AutoViML commented 8 months ago

@DirtyStreetCoder @ConsciousML 👍 I believe this is a problem between hvplot.pandas and the newer python versions such as 3.10 and 3.11

I suggest you try to uninstall and reinstall the correct version of hvplot.pandas that can work in your environments. If that install works and you can import it, it should be easy for AutoViz to also import it.

That's why I am closing this issue here. Please re-open it if there is an AutoViz related issue. Thanks Auto Vimal