som/som.py
def quantization_error(self, test_vectors):
        """Calculates the quantization_error for one or multiple vectors."""

        if not isinstance(test_vectors, collections.Iterable):
            test_vectors = [test_vectors]

        distances = (self.bmu(test_vector).distance(test_vector)
                     for test_vector in test_vectors)
        return sum(distances) / len(test_vectors)
Calculates the quantization_error for one or multiple vectors.
Calculates the quantization_error for one or multiple vectors.
Calculates the quantization_error for one or multiple vectors .
def quantization_error(self, test_vectors):
        if not isinstance(test_vectors, collections.Iterable):
            test_vectors = [test_vectors]
        distances = (self.bmu(test_vector).distance(test_vector)
                     for test_vector in test_vectors)
        return sum(distances) / len(test_vectors)
def quantization_error ( self , test_vectors ) : if not isinstance ( test_vectors , collections . Iterable ) : test_vectors = [ test_vectors ] distances = ( self . bmu ( test_vector ) . distance ( test_vector ) for test_vector in test_vectors ) return sum ( distances ) / len ( test_vectors )
Calculates the quantization_error for one or multiple vectors.
Calculates the quantization_error for one or multiple vectors .
"""Calculates the quantization_error for one or multiple vectors."""
self
test_vectors