TweedieRegressor fits a generalized linear regression model with a Tweedie distribution and log link. It is useful when targets combine many zeros with positive, right-skewed values, such as insurance, weather, health, or rental outcomes. section 7.1.4 section 7.5
Configure the estimator around two important hyperparameters:
- Set alpha to control the L2 regularization term. section 7.4.2
- Search power between 1 and 2 to tune the Tweedie distribution; power=1 is equivalent to PoissonRegressor. section 7.4.2
- Compare predictions with MSE, MAE, and R2, rather than assuming a normal-error model is appropriate. section 7.4.2
Bike-rental prediction
A grid search varies alpha and power while training TweedieRegressor(max_iter=1000). On the bike-rental data, the tuned Tweedie model obtains test MSE 1,254.304, test MAE 20.661, and test R2 0.454. It can also serve as a base estimator in a stacking ensemble.
Table 7.2 GLMs for different types of labels (view table figure)
Compare Tweedie regression with linear, Gamma, Poisson, and logistic GLMs by link function, distribution, and target type. section 7.1.4
