Privacy-preserving data sharing in high dimensional regression and classification settings