Skip to content
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

Add possibility to choose the order of the returned numpy array in Somoclu.get_bmus() #146

Merged
merged 1 commit into from
Oct 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Python/somoclu/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,8 @@ def get_bmus(self, activation_map, order='F'):
:param activation_map: Activation map computed with self.get_surface_state()
:type activation_map: 2D numpy.array

:param order: order of returned numpy array, 'F' or 'C'
:param order: order of returned numpy array, 'F' for column-major
(Fortran-style) or 'C' for row-major (C-style).

:returns: The bmus indexes corresponding to this activation map
(same as self.bmus for the training samples).
Expand All @@ -600,7 +601,7 @@ def get_bmus(self, activation_map, order='F'):
if order == 'F':
return np.vstack((X, Y)).T
elif order == 'C':
return np.vstack((X, Y))
return np.vstack((Y, X)).T

def view_similarity_matrix(self, data=None, labels=None, figsize=None,
filename=None):
Expand Down