I'm trying to cluster MNIST dataset, I'm using PCA(for dimension reduction) and kmeans for clustering. For now I'm using just raw vector of pixels, I tried to convert it with Local Binary Patterns but it still gives bad results, I think I need to compute histograms based on LBP, but not sure how? I use code from here