Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Interpretml Interpret PseudoHuberRegressionObjective

From Leeroopedia


Knowledge Sources
Domains Machine_Learning, EBM_Core
Last Updated 2026-02-07 12:00 GMT

Overview

Implements the Pseudo-Huber regression objective function, a smooth approximation of the Huber loss that provides robustness to outliers.

Description

The PseudoHuberRegressionObjective.hpp defines the PseudoHuberRegressionObjective struct, which implements the Pseudo-Huber loss function with identity link. The Pseudo-Huber loss is a smooth (differentiable everywhere) approximation of the Huber loss, parameterized by a delta value that controls the transition between quadratic and linear behavior. The metric is delta^2 * (sqrt(1 + (error/delta)^2) - 1). The gradient is error / sqrt(1 + (error/delta)^2), using FastApproxDivide for performance. The hessian is 1 / (calc * sqrt(calc)) where calc = 1 + (error/delta)^2, using FastApproxReciprocal. The delta parameter must be positive, finite, and must not cause delta^2 or 1/delta to overflow or become infinite.

Usage

Used when the user specifies the "pseudo_huber" objective for robust regression that is less sensitive to outliers than RMSE. The delta parameter controls the outlier threshold.

Code Reference

Source Location

  • Repository: Interpretml_Interpret
  • File: shared/libebm/compute/objectives/PseudoHuberRegressionObjective.hpp

Signature

template<typename TFloat> struct PseudoHuberRegressionObjective : RegressionObjective {
   OBJECTIVE_BOILERPLATE(PseudoHuberRegressionObjective, MINIMIZE_METRIC,
       Objective_Other, Link_identity, true)

   TFloat m_deltaInverted;
   double m_deltaSquared;

   inline PseudoHuberRegressionObjective(const Config& config, const double delta);
   inline bool CheckRegressionTarget(const double target) const noexcept;
   inline double FinishMetric(const double metricSum) const noexcept;  // m_deltaSquared * 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 sqrt(1 + (error/delta)^2) - 1
CalcGradient error / sqrt(1 + (error/delta)^2)
CalcGradientHessian gradient = error/sqrt(calc); hessian = 1/(calc * sqrt(calc))
Parameter Constraint
delta Must be positive, finite; delta^2 and 1/delta must be finite

Usage Examples

# Called internally via native bindings
from interpret.glassbox import ExplainableBoostingRegressor
ebm = ExplainableBoostingRegressor(objective="pseudo_huber")
ebm.fit(X, y)  # Uses PseudoHuberRegressionObjective for robust regression

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment