Skip to content

Commit

Permalink
Call find_bmu method after last training iteration
Browse files Browse the repository at this point in the history
This issue was affecting some visualizations such as BmuHitsView, which
was calling som._bmu[0] to get the number of observations allocated to
each unit as their BMU.

Tests were made which compared the new output of BmuHitsView with
som.project_data() output. They matched as expected.

Fixes #83
  • Loading branch information
dfhssilva committed Feb 7, 2021
1 parent 6bd2ced commit bc80803
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sompy/sompy.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ def _batchtrain(self, trainlen, radiusin, radiusfin, njob=1,
logging.info("nan quantization error, exit train\n")

#sys.exit("quantization error=nan, exit train")


bmu = self.find_bmu(data, njb=njob)
bmu[1] = np.sqrt(bmu[1] + fixed_euclidean_x2)
self._bmu = bmu

Expand Down

0 comments on commit bc80803

Please sign in to comment.