Learning sparse generalized linear models with binary outcomes via iterative hard thresholding