1. 学习
  2. /
  3. 课程
  4. /
  5. Generalized Linear Models in Python

Connected

练习

Fitting a Poisson regression

Continuing with the crab dataset you will fit your first Poisson regression model in this exercise.

The crab dataset has been preloaded in the workspace.

说明

100 XP
  • Import statsmodels.api library as sm.
  • Import glm from statsmodels.formula.api.
  • Using Poisson() for the response distribution fit the Poisson regression with satas the response and weight for the explanatory variable.
  • Display the model results using .summary().