Discriminative principal component analysis for high dimensional classification with applications in NIR spectroscopy