1. Učit se
  2. /
  3. Kurzy
  4. /
  5. Generalized Linear Models in Python

Connected

cvičení

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.

Pokyny

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