Implementation:Interpretml Interpret PoissonDevianceRegressionObjective
| Knowledge Sources | |
|---|---|
| Domains | Machine_Learning, EBM_Core |
| Last Updated | 2026-02-07 12:00 GMT |
Overview
Implements the Poisson deviance regression objective function for modeling count data with the log link function.
Description
The PoissonDevianceRegressionObjective.hpp defines the PoissonDevianceRegressionObjective struct, which implements Poisson distribution deviance loss for regression on non-negative targets (typically count data). It uses the log link function where prediction = exp(score). The gradient is prediction - target and the hessian is prediction. The metric computation handles the special case where target is zero (since log(0) is undefined) by using an IfThenElse conditional to treat near-zero fractions (below float min) as zero. FinishMetric multiplies by 2.0 for standard deviance scaling. The code notes that XGBoost and LightGBM have a max_delta_step parameter (default 0.7) that effectively changes the learning rate by 1/e^0.7 -- to get equivalent behavior, users can multiply the EBM learning rate by approximately 0.4966.
Usage
Used when the user specifies the "poisson_deviance" objective for modeling count data or non-negative targets that follow a Poisson distribution, such as event counts or rates.
Code Reference
Source Location
- Repository: Interpretml_Interpret
- File: shared/libebm/compute/objectives/PoissonDevianceRegressionObjective.hpp
Signature
template<typename TFloat> struct PoissonDevianceRegressionObjective : RegressionObjective {
OBJECTIVE_BOILERPLATE(PoissonDevianceRegressionObjective, MINIMIZE_METRIC,
Objective_Other, Link_log, true)
inline PoissonDevianceRegressionObjective(const Config& config);
inline bool CheckRegressionTarget(const double target) const noexcept;
inline double FinishMetric(const double metricSum) const noexcept; // returns 2.0 * metricSum
GPU_DEVICE inline TFloat CalcMetric(const TFloat& score, const TFloat& target) const noexcept;
GPU_DEVICE inline TFloat CalcGradient(const TFloat& score, const TFloat& target) const noexcept;
GPU_DEVICE inline GradientHessian<TFloat> CalcGradientHessian(
const TFloat& score, const TFloat& target) const noexcept;
};
I/O Contract
| Method | Formula |
|---|---|
| CalcMetric | exp(score) - target + target * log(target / exp(score)) [with zero handling] |
| CalcGradient | exp(score) - target |
| CalcGradientHessian | gradient = prediction - target; hessian = prediction |
Usage Examples
# Called internally via native bindings
from interpret.glassbox import ExplainableBoostingRegressor
ebm = ExplainableBoostingRegressor(objective="poisson_deviance")
ebm.fit(X, y) # Uses PoissonDevianceRegressionObjective for count data