sevamoo / SOMPY

A Python Library for Self Organizing Map (SOM)
Apache License 2.0
535 stars 242 forks source link

lenght error #125

Closed Hudson11 closed 3 years ago

Hudson11 commented 3 years ago

hello, I'm trying to use some of the visualization forms, however, I always run into the same error.

Model mapsize = [10,10] som = sompy.SOMFactory.build(diabetes, mapsize, mask=None, mapshape='planar', lattice='rect', normalization='var', initialization='pca', neighborhood='gaussian', training='batch', name='sompy') som.train(n_job=1, verbose='info')

MapView `from sompy.visualization.mapview import View2D

view2D = View2D(10,10,"", text_size=7) view2D.show(som) plt.show()`

error2

abdoulsn commented 3 years ago

I've this error when I was on small projet, never fixed. But once I look in source code it seems mapsize is automatically calculated using initialiaze using mapsize = self.calculate_map_size(lattice) if not mapsize else mapsize the calculate_map_size() function calculate it from latine. Now if you want to fix your own, here come the issues I think.

This repo is not very active to come over all issues I do do not know why the owner @sevamoo never react.

Hudson11 commented 3 years ago

ok thank you so much

Hudson11 commented 3 years ago

hello, I managed to solve this problem using a different input format. I was passing the model a pandas dataset.DataFrame (dataset = pd.read_csv (directory), so it looks like this won't work in some situations, so I decided to convert it to an array.

dataset = pd.read_csv(directory) dataset_data = dataset.iloc[**args].values

sevamoo commented 3 years ago

Sorry, for my late reply here. Unfortunately, I am not able to answer all the issues, but usually, I would be glad to accept your pull requests if you found an error and managed to fix it. Best Vahid