Comments (2)
hi, thanks for raising this issue. I don't have capacity to maintain this notebook and it will soon be removed. Feel free to submit a PR with the changes if you solve the issues.
from minisom.
ok, my oversight - I checked again. However, 2 errors still remain:
The property plot : Type error: 'float' object is not iterable
I fixed this error by:
zmin = min(properties.iloc[:,2:].min())
zmax = max(properties.iloc[:,2:].max())
def plotDistributionOfDataInClusters: AttributeError: 'DataFrame' object has no attribute 'append'
I fixed this error by:
def plotDistributionOfDataInClusters(som, data, columns, plottype='barpolar'):
size = som.distance_map().shape[0]
clusters = np.array(np.arange(0, size*size)).reshape(size, size)
distributionMapData = []
labels_map = som.labels_map(data, [label_names[t] for t in target])
win_map = som.win_map(data)
for position in win_map.keys():
label_fracs = [labels_map[position][l] for l in label_names.values()]
bgcolor = label_fracs.index(np.max(label_fracs))*255//len(label_fracs)
winner = win_map[position]
minima = np.min(winner, axis=0)
means = np.mean(winner, axis=0)
maxima = np.max(winner, axis=0)
row = int(position[1]+1)
col = int(position[0]+1)
distributionMapData.append({'col': col, 'row': size-row+1, 'min': minima, 'mean': means, 'max': maxima, 'bgcolor' : bgcolor})
noClusters = np.max(clusters).item() + 1
clusterData = pd.DataFrame(columns=['col', 'row', 'min', 'mean', 'max'])
maximum = np.amax([d['max'] for d in distributionMapData])
minimum = np.amin([d['min'] for d in distributionMapData])
distributionMapData = pd.DataFrame(distributionMapData)
distributionMapData = pd.concat([distributionMapData], ignore_index=True)
distributionMap(distributionMapData, clusters, size, columns, minimum, maximum, plottype)
plotDistributionOfDataInClusters(som, data, columns[:-1], plottype='barpolar')
from minisom.
Related Issues (20)
- Question on the radius. HOT 2
- About how you efficiently calculate the winner and the neighbourhood function. HOT 1
- How can I get reproducible results? HOT 2
- Meaning of the position of winning nodes and distance map HOT 3
- considerations on the hexagonal neighborhood used in `distance_map()` HOT 6
- It seems the next run will be influenced by the former run. Will it be more rational to reset after every run? HOT 4
- Is there a way to create clusters of equal size? HOT 2
- What's the order of the coordinates returned by the winner method? HOT 2
- How to save and load trained model for cluster prediction on new data? HOT 1
- PCA initialization HOT 7
- Adjacent nodes in hexagonal distance do not have distance 1 HOT 2
- Question: Interest in a connectivity matrix? HOT 2
- unexpected problem calling the functions HOT 11
- Help with clustering and visualization of neurons HOT 1
- There might be an index error in TimeSeries.ipynb HOT 1
- decay for sigma can be improved HOT 5
- Large Quantization Error with Spatio-Temporal Data? HOT 10
- error in clustering SST data
- Can i do SOM for multiple variables? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minisom.