

def __init__(self, hash_name, projection_count, training_set):
    '\n        Computes principal components for training vector set. Uses\n        first projection_count principal components for projections.\n\n        Training set must be either a numpy matrix or a list of\n        numpy vectors.\n        '
    super(PCABinaryProjections, self).__init__(hash_name)
    self.projection_count = eigenvectors
    if (not (training_set is None)):
        training_set = numpy_array_from_list_or_numpy_array(training_set)
        self.dim = training_set.shape[0]
        training_set_t = numpy.transpose(training_set)
        (eigenvalues, eigenvectors) = perform_pca(training_set_t)
        largest_eigenvalue_indices = numpy.flipud(scipy.argsort(eigenvalues))[:projection_count]
        self.components = numpy.zeros((self.dim, len(largest_eigenvalue_indices)))
        for index in range(len(largest_eigenvalue_indices)):
            self.components[:, index] = eigenvectors[:, largest_eigenvalue_indices[index]]
        self.components = numpy.transpose(self.components)
    else:
        self.dim = None
        self.components = None
    self.components_csr = None

dataset/ETHPy150Open pixelogik/NearPy/nearpy/hashes/pcabinaryprojections.py PCABinaryProjections.__init__/VarMisuse@34/125 `projection_count`->`eigenvectors`