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().