A Unified Framework for Dimensionality Reduction