Algorithms for Collaborative Machine Learning under Statistical Heterogeneity