From f053c0eb05bd21d2ae5e288e3ca6d0a46049ef76 Mon Sep 17 00:00:00 2001 From: Giacomo Lanciano Date: Fri, 25 Oct 2019 16:08:11 +0200 Subject: [PATCH] #145 add possibility to choose the order of the returned numpy array in Somoclu.get_bmus() --- src/Python/somoclu/train.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Python/somoclu/train.py b/src/Python/somoclu/train.py index 969cade..4dd8c67 100644 --- a/src/Python/somoclu/train.py +++ b/src/Python/somoclu/train.py @@ -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). @@ -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):