Package: neural-map
NeuralMapNeuralMap is  new Python implementation of the well-known self organized artificial neural network,Self-Organizing Map (SOM), with theRelative Position (RP) Visualization method. The RP is a node-adaptive attribute that moves in a two dimensional space mimicking, at training stage, the movements of the SOM's codebook vectors in the input space.In this wayNeuralMapresults in a powerfulldata analysistool that generates both alow-dimensionalrepresentation of the input data as tSNE or UMAP tools and placing codebook vectors in the input space providing a smoother version of the input space. In addition, it maps data similarity into both codebook vectors and RP neighborness, thus allowing clear identification of similarity in the two dimensional space, with the added advantage of precessing new inputs without retraining needs.This tool supports awide range of configurations:Customdistance metricHexagonal or squarearrangementToroidal or flattopologyCustom radius or learning ratedecay functionsCustomneighbourhood functionsAfter training aNeuralMap instance, you will be able to getuseful informationabout your data, by mapping
observations to the SOM, watching thefeatures distributionover the map, analysing a dataset to get thequantization error,activation frequencyandmean distancefor each node, andevaluatingthe SOM.Since the use of SOM forclusteringis very spread, NeuralMap also includes several highly customizablevisualization methods, some of them based on theRelative Positions techniqueto improve the interpretability of results and clusters recognition.For instance, we have implemented some common clustering algorithms to search clusters into the SOM configuration, speeding up the search of clusters in the smoothed space representation achieved by the SOM codebook vectors or RP rather than in the, possible, high dimensional imput space:HDBSCANK-meansK-medoidsInstallationNeuralMap has the following requirements:python >= 3.6numpy 1.18.3numba 0.50.1scikit_learn_extra 0.1.0b2matplotlib 3.2.1scipy 1.4.1hdbscan 0.8.26scikit_learn 0.23.2To install NeuralMap use:pipinstallneural-mapGetting startedAfter installing NeuralMap,obtainandprepareyour dataset. For this example we will create a dataset with 10blobsin a five
dimensional space and scale it to fit the observations to the range [0, 1]:fromsklearnimportdatasets,preprocessingblobs=datasets.make_blobs(n_samples=1000,n_features=5,centers=10,random_state=1)scaler=preprocessing.MinMaxScaler()data=scaler.fit_transform(blobs[0])Then, we have tocreatea NeuralMap instance andtrain itwith the data:fromneural_mapimportNeuralMapnm=NeuralMap(5,'euclidean',columns=10,rows=10)nm.train(data,n_epochs=20)Now we can obtain adiscrete representationusing the HB-SCAN over the codebook vectors and represented in the two dimensional space mapped trhough the Relative Positions:nm.plot_analysis(data)NeuralMap was able to successfullydiscoverand cluster all theoriginal blobs.It's also possible to get theU-matrix:nm.plot_unified_distance_matrix()Here is also possible to recognize the 10 original blobs.DocumentationFor more details, see theNeuralMap documentation.If you have aquestion, please open anissue.AuthorsElmer AndrÃ©s FernÃ¡ndez-Original Idea-Profile- [CIDIE]-CONICET-UCCFranco Bobadilla-Developer- Universidad CatÃ³lica de CÃ³rdobaPablo Pastore-Advice- Universidad CatÃ³lica de CÃ³rdobaContributingTocontribute, do the following:Open anissueto discuss possible changes or ask questionsCreate aforkof the projectCreate a newbranchand push your changesCreate apull requestLicenseNeuralMap is licensed underMIT license.