som/basic_som.py
def polar_plots(self):
        """Shows for each node the attributes of the codebook vector as a polar
        plot.
        """
        fig, axes = plt.subplots(self.codebook.height, self.codebook.width,
                                 subplot_kw={'polar': True})
        normalized_codebook = normalize(x.vector for x in self.codebook)

        for ax, codebook_vector in zip(chain(*axes), normalized_codebook):
            n = len(codebook_vector)
            thetas = np.linspace(0, 2 * np.pi, n, endpoint=False)
            radii = codebook_vector
            bars = ax.bar(thetas, radii, width=2 * np.pi / n)

            ax.get_xaxis().set_visible(False)
            ax.get_yaxis().set_visible(False)
            for i, bar in enumerate(bars):
                bar.set_facecolor(plt.cm.jet(i / n))
                bar.set_alpha(0.5)

        fig.suptitle('Polar plots')
        plt.show()
Shows for each node the attributes of the codebook vector as a polar
        plot.
        
Shows for each node the attributes of the codebook vector as a polar
plot.
Shows for each node the attributes of the codebook vector as a polar plot .
def polar_plots(self):
        fig, axes = plt.subplots(self.codebook.height, self.codebook.width,
                                 subplot_kw={'polar': True})
        normalized_codebook = normalize(x.vector for x in self.codebook)
        for ax, codebook_vector in zip(chain(*axes), normalized_codebook):
            n = len(codebook_vector)
            thetas = np.linspace(0, 2 * np.pi, n, endpoint=False)
            radii = codebook_vector
            bars = ax.bar(thetas, radii, width=2 * np.pi / n)
            ax.get_xaxis().set_visible(False)
            ax.get_yaxis().set_visible(False)
            for i, bar in enumerate(bars):
                bar.set_facecolor(plt.cm.jet(i / n))
                bar.set_alpha(0.5)
        fig.suptitle('Polar plots')
        plt.show()
def polar_plots ( self ) : fig , axes = plt . subplots ( self . codebook . height , self . codebook . width , subplot_kw = { 'polar' : True } ) normalized_codebook = normalize ( x . vector for x in self . codebook ) for ax , codebook_vector in zip ( chain ( * axes ) , normalized_codebook ) : n = len ( codebook_vector ) thetas = np . linspace ( 0 , 2 * np . pi , n , endpoint = False ) radii = codebook_vector bars = ax . bar ( thetas , radii , width = 2 * np . pi / n ) ax . get_xaxis ( ) . set_visible ( False ) ax . get_yaxis ( ) . set_visible ( False ) for i , bar in enumerate ( bars ) : bar . set_facecolor ( plt . cm . jet ( i / n ) ) bar . set_alpha ( 0.5 ) fig . suptitle ( 'Polar plots' ) plt . show ( )
Shows for each node the attributes of the codebook vector as a polar
plot.
Shows for each node the attributes of the codebook vector as a polar plot .
"""Shows for each node the attributes of the codebook vector as a polar
        plot.
        """
self