Giter VIP home page Giter VIP logo

som's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

som's Issues

May I know how to do prediction out of it please?

Hi,

  1. May I know a prediction function available?
  2. In Creating dummy target values in the example, you have done 500 each, is that random, are can we do some kmeans before that and find the labels and assign that

IndexError: list index out of range

Im try to use the iris dataset, but I get errors all the time

my code

iris = pd.read_csv('Iris.csv')
dataset = iris.drop(['Species','Id'],axis = 1)
from sklearn.preprocessing import StandardScaler

standard = StandardScaler()
cleanDataSet = standard.fit_transform(dataset)
cleanDataSet = pd.DataFrame(cleanDataSet).dropna()

som = SOM(10, 10)  # initialize the SOM
som.fit(cleanDataSet.to_numpy(), 10000, save_e=True, interval=100)
species = iris['Species']
species_number = species.astype('category').cat.codes
som.plot_point_map(cleanDataSet.to_numpy(), species_number, species)

and the error

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-134-1f7b119e8ffe> in <module>()
----> 1 som.plot_point_map(cleanDataSet.to_numpy(), species_number, species)

1 frames
/content/som.py in <listcomp>(.0)
    285 
    286         if not activities:
--> 287             patches = [mptchs.Patch(color=colors[i], label=targetnames[i]) for i in range(len(targetnames))]
    288             legend = plt.legend(handles=patches, bbox_to_anchor=(0., 1.02, 1., .102), loc=3, ncol=len(targetnames),
    289                                 mode="expand", borderaxespad=0.1)

IndexError: list index out of range

ValueError: Length of passed values is 15, index implies 4

I'm don't understand why is this error?

my code:

iris = pd.read_csv('Iris.csv')
dataset = iris.drop(['Species','Id'],axis = 1)
from sklearn.preprocessing import StandardScaler

standard = StandardScaler()
cleanDataSet = standard.fit_transform(dataset)
cleanDataSet = pd.DataFrame(cleanDataSet).dropna()

som = SOM(10, 10)  # initialize the SOM
som.fit(cleanDataSet.to_numpy(), 10000, save_e=True, interval=100)
species = iris['Species']
species_number = species.astype('category').cat.codes
# take row 7 for get neighbors 
som.get_neighbors(cleanDataSet.iloc[7], data= cleanDataSet.to_numpy(), labels=species.unique() , d=0)

and the error:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-188-ae42eea72444> in <module>()
----> 1 som.get_neighbors(cleanDataSet.iloc[7], data= cleanDataSet.to_numpy(), labels=['7'] , d=0)

4 frames
/usr/local/lib/python3.6/dist-packages/pandas/core/series.py in __init__(self, data, index, dtype, name, copy, fastpath)
    247                             'Length of passed values is {val}, '
    248                             'index implies {ind}'
--> 249                             .format(val=len(data), ind=len(index)))
    250                 except TypeError:
    251                     pass

ValueError: Length of passed values is 15, index implies 4

IndexError: list index out of range

hi there,
i keep on having this issue:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 3331, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
som.plot_point_map(dfs.to_numpy(), labels, np.unique(labels))
File "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", line 278, in plot_point_map
markers[targets[cnt]], color=c, markersize=12)
IndexError: list index out of range

can you help?
alex

Install from pypi failing

Hi there - thanks for making this available!

Installation with pip currently fails for me on MacOS 10.15.7 and python 3.6.13 with this error:

...
        with open('requirements.txt', 'r') as f:
    FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
...

Installing directly from github works with:

pip install git+https://github.com/alexarnimueller/som

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.