Regression: objectives and metrics¶
Objectives and metrics¶
The formulas use the variables common to all metrics. Each formula is the weighted mean of the unit deviance of the distribution.
squared_error¶
The identity link: \(\mu_i = a_i\).
poisson¶
The log link: \(\mu_i = e^{a_i}\). The term \(t_i \log\frac{t_i}{\mu_i}\) is 0 when \(t_i = 0\).
Labels \(t_i\) should be non-negative. Pass the exposure (for example, the policy duration) in the
exposure parameter of fit rather than dividing the target by it.
gamma¶
The log link: \(\mu_i = e^{a_i}\).
Labels \(t_i\) should be positive.
tweedie¶
The log link: \(\mu_i = e^{a_i}\). \(\rho\) is the value of the
tweedie_rho parameter, in the range \((1; 2)\).
Labels \(t_i\) should be non-negative.
Used for optimization¶
| Name | Optimization | Link | Metric function |
|---|---|---|---|
| squared_error | + | identity | mean_tweedie_deviance(power=0) |
| poisson | + | log | mean_poisson_deviance |
| gamma | + | log | mean_gamma_deviance |
| tweedie | + | log | mean_tweedie_deviance(power=tweedie_rho) |
The metric functions are in the t_boost.metrics module. Pass
them the expected totals (\(\mu_i\), which is predict(X) * exposure for a model trained with an
exposure).