-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map cells with 0 hits - reshape error #94
Comments
Your question is not really clear to me. If you want to visualize the values of the data points, you need to write your own plot. Just convert the bmus to xy values and then use some sort of scatter plots for the training data. When there are nodes between bmu nodes, this means there is a clear cluster border and those nodes are in those borders. Therefore, reducing the som size to 3x3 is not a good idea. |
@sevamoo taking a step back...generally the problem is that the reshaping you used in the notebook (as posted by @germayneng) doesn't work on all data, even though from the looks of it it should be a technique that can be generalized to any data what do you think might be happening thats causing the reshaping errors, if it isnt the unique bmu count problem I described in the original question? |
To see selected components:
Since in my data I have BMU with 0 hits I had to make a different code
With k nearest neighbours I can attribute a coordinate of the variable not used to create the som. |
Dear akol67, The code posted is only to be analysed. Out of context doesn't work. |
In my context, the variables Temp, Consumo, WorkingDays and TotalMinutesDay are exogenous and the only way I think is possible to construct the exogenous components map is by applying the mean of the nearest neighbours of a given neuron. Even if you make value=1 where BMU hit is zero, when constructing the exogenous components map, you would still have the problem that some neurons(nodes) would not be BMU of any data, so you cannot use sompy codes which retrieve the values of the exogenous variables from the data related to that neuron. |
Dear Ricardo,
It worked!
…_____________________________________________________________________________
vars = ['Temp','Consumo','WorkingDays']
Nodes=pd.DataFrame(som_chosen._normalizer.denormalize_by(
som_chosen.data_raw,som_chosen.codebook.matrix), columns=Labels)
Nodes_with_selected_variables = Nodes[vars]
Em seg., 17 de mai. de 2021 às 12:09, ricardomourarpm <
***@***.***> escreveu:
NameError: name 'som_chosen' is not defined
Dear akol67,
The code posted is only to be analysed. Out of context doesn't work.
som_chosen is the som I've trained for my example.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#94 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI3MX6QNIBFN3TRXIQ4LTV3TOEWUPANCNFSM4GF4A3CA>
.
--
*Att*
*Alexandre Kolisnyk*
|
I'm following the AirFlights example using my own dataset but run into a problem when I try to plot the real values component plane
I get a reshape error when I reach the following code:
I checked the values in
df['bmus']
. The max bmu value is 99, but there are only 68 unique bmu values. So this means I have too little data for my mapsize because some map cells are not being chosen as the bmu, and those cells are therefore not represented indf['bmus']
. This is confirmed by plotting the hitsmap, which shows a number of cells with 0 hitsI can fix this by reducing my map size, but it only works if I go down to 3x3, which is pretty pointless
Is there any other way to get around this problem?
View2D
allows me to plot the prototype planes with no problem using the same model, despite some cells not being chosen as the best unit. Any way to do this with the real value planes as well? Maybe fill in the missing bmu values somehow?The text was updated successfully, but these errors were encountered: