Dimensionality reduction and classification play an absolutely critical role in pattern recognition and machine learning. In this work, we present a quantum neighborhood preserving embedding and a quantum local discriminant embedding for dimensionality reduction and classification. These two algorithms have an exponential speedup over their respectively classical counterparts. Along the way, we propose a variational quantum generalized eigenvalue solver (VQGE) that finds the generalized eigenvalues and eigenvectors of a matrix pencil $(\mathcal{G},\mathcal{S})$ with coherence time $O(1)$. We successfully conduct numerical experiment solving a problem size of $2^5\times2^5$. Moreover, our results offer two optional outputs with quantum or classical form, which can be directly applied in another quantum or classical machine learning process.