Path following algorithms for \ell_2 -regularized M -estimation with approximation guarantee