GLM implementation using python packages