Reducing dimensionality of molecular systems: a Bayesian non-parametric approach