Supervised dimensionality reduction for big data