Sufficient Dimension Reduction in Complex Datasets