Photometric redshift estimation using generalized linear models