som/basic_som.py
def label_plot(self):
        """If there are class labels available for the data, we plot the
        SOM with labels on the nodes where this class is the most frequent.
        """
        assert self.labels is not None

        normalized_codebook = normalize(node.vector for node in self.codebook)
        raster = split_generator(normalized_codebook, self.codebook.width)
        three_feats = [[vector[:3] + [.7] for vector in row] for row in raster]
        plt.imshow(three_feats, interpolation='none')

        for label in set(self.labels) - set([None]):
            class_node = max(self.codebook, key=lambda node: node.labels[label])
            plt.text(class_node.row, class_node.col, label,
                     horizontalalignment='center', verticalalignment='center')

        plt.title('Label plot')
        plt.show()
If there are class labels available for the data, we plot the
        SOM with labels on the nodes where this class is the most frequent.
        
If there are class labels available for the data, we plot the
SOM with labels on the nodes where this class is the most frequent.
If there are class labels available for the data we plot the SOM with labels on the nodes where this class is the most frequent .
def label_plot(self):
        assert self.labels is not None
        normalized_codebook = normalize(node.vector for node in self.codebook)
        raster = split_generator(normalized_codebook, self.codebook.width)
        three_feats = [[vector[:3] + [.7] for vector in row] for row in raster]
        plt.imshow(three_feats, interpolation='none')
        for label in set(self.labels) - set([None]):
            class_node = max(self.codebook, key=lambda node: node.labels[label])
            plt.text(class_node.row, class_node.col, label,
                     horizontalalignment='center', verticalalignment='center')
        plt.title('Label plot')
        plt.show()
def label_plot ( self ) : assert self . labels is not None normalized_codebook = normalize ( node . vector for node in self . codebook ) raster = split_generator ( normalized_codebook , self . codebook . width ) three_feats = [ [ vector [ : 3 ] + [ .7 ] for vector in row ] for row in raster ] plt . imshow ( three_feats , interpolation = 'none' ) for label in set ( self . labels ) - set ( [ None ] ) : class_node = max ( self . codebook , key = lambda node : node . labels [ label ] ) plt . text ( class_node . row , class_node . col , label , horizontalalignment = 'center' , verticalalignment = 'center' ) plt . title ( 'Label plot' ) plt . show ( )
If there are class labels available for the data, we plot the
SOM with labels on the nodes where this class is the most frequent.
If there are class labels available for the data we plot the SOM with labels on the nodes where this class is the most frequent .
"""If there are class labels available for the data, we plot the
        SOM with labels on the nodes where this class is the most frequent.
        """
self