131 questions
0
votes
1
answer
37
views
How can I resolve dimension mismatch or weight display issues in a Kohonen neural network using Python?
I am implementing a Kohonen Self-Organizing Map (SOM) in Python. My goal is to train the SOM on scaled input data (X_scaled) and iteratively update the weights over several epochs. However, I am ...
0
votes
0
answers
45
views
How do you know which is the closest class example(observation) to a class in Self Organizing Map?
For example there are two classes C1 and C2, distance1 and distance2,
The rule tells which class is: If distance1 > distance2 than class C1 (Node1) else class C2 (Node2)
Here are some data examples:...
-1
votes
1
answer
217
views
Evaluate performance of Self-organizing map for classification
I'm trying to use a Self-Organizing map (SOM) as a clustering method on the Iris dataset.
% Load dataset
load iris.dat
X = iris(:,1:end-1);
true_labels = iris(:,end);
% Train SOM
net = newsom(X',[10,...
0
votes
0
answers
93
views
Is there a way to obtain the same results of numpy function with tensorflow tensors?
I want to create a custom keras layer that compute the "predict" of a Self Organizing Map.
Here is my implementation of the layer
`
class SOMLayer(keras.layers.Layer):
def __init__(self, ...
1
vote
1
answer
574
views
How does the number of iterations affect convergence in a self-organizing map?
I'm training a self-organizing map (SOM) using the kohonen library in R and I get some confusing results when I adjust the rlen parameter in the som call. According to the help file, rlen is the "...
0
votes
1
answer
207
views
Example Java code for Kohonen filter using apache.commons.math.ml
I am looking for any example code for implementing Kohonen SOM using the apache.commons.math3.neuralnet.sofm classes. To make the question less ambiguous, I'll share that I plan to explore using it to ...
-1
votes
1
answer
345
views
Transform 2d plot into 1d plot
I'm trying to understand self-organising map neural network with Python. Here's a code:
import numpy as np
from numpy.ma.core import ceil
from scipy.spatial import distance
from sklearn.preprocessing ...
0
votes
0
answers
385
views
Regression with Self Organizing Map (SOM) / Kohonen Map
I am evaluating an SOM/Kohonen Map as a regressor for a dataset. Unfortunately it performs extremely bad - so bad, that I think I might have an error in my code. While the R2 score for the training ...
0
votes
0
answers
202
views
How to define neighborhoods in hexagonal Self-Organizing Maps (SOM)
I'm trying to implement a bi-dimensional SOM with shrinking neighborhoods, but to avoid computing the neighborhood function to each neuron for every input, I want to define the neighbors for each ...
0
votes
0
answers
97
views
How to calculate the distance between a random point in a dataset and a center for the kohonen algorithm?
I'm trying to calculate the distance between a random datapoint in the dataset and the center for the centroid. However, I get an error.
dist= math.sqrt((W[k][0]-dataset[0])**2 + (W[k][1]-dataset[1]**...
1
vote
1
answer
182
views
Tableau: Self-Organizing Map visualization
So, it's my first time trying to make my own data visualization, and what I want to do is something like a heat map or highlighted table like the original Kohonen (but using squares rather than ...
1
vote
1
answer
465
views
Convert dataframe to matrix list
How to create a daily numeric matrix from a data frame with x, y, date, and value columns.
I am trying to implement the SOM function from the Kohonen package in R for my data frame dtt. It requires a ...
1
vote
1
answer
2k
views
Library sompy for implementing self-organizing maps
I have installed the library sompy, but when I import it I have the next error:
import sompy
ImportErrorTraceback (most recent call last)
<ipython-input-86-97d518356b3c> in <module&...
0
votes
0
answers
553
views
How to combine PCA with SOM in order to get proper cluster of data points in python?
I have around 5 different cases where I extract around 13/14 statistical features from each case. I wanted to create like anomaly detection where I reduce the feature matrix using Principal Component ...
0
votes
0
answers
123
views
(SOM) Weighing neighbours in a matrix, simpler way than RBF?
I've been implementing the SOM algorithm and trying to now change out functions I've used from sklearn.
For a particular SOM problem, I've set a neighborhoodmap to
np.array(
[[[a, b] for b in range(...