def reduce_dims(matrix, target_dim):
    'Reduce dimensionality of the data using PCA.\n\n    Args:\n        matrix (np.ndarray): Matrix of the form (n_sampes, n_features)\n        target_dim (uint): Dimension to which n_features should be reduced to.\n\n    '
    model = PCA(n_components=target_dim)
    model.fit(matrix)
    return model.transform(matrix)
Reduce dimensionality of the data using PCA.

Args:
    matrix (np.ndarray): Matrix of the form (n_sampes, n_features)
    target_dim (uint): Dimension to which n_features should be reduced to.
def reduce_dims(matrix, target_dim):
    'Reduce dimensionality of the data using PCA.\n\n    Args:\n        matrix (np.ndarray): Matrix of the form (n_sampes, n_features)\n        target_dim (uint): Dimension to which n_features should be reduced to.\n\n    '
    model = PCA(n_components=target_dim)
    model.fit(matrix)
    return model.transform(matrix)