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 RmseLogLinkRegressionObjective

From Leeroopedia


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

Overview

Implements the RMSE regression objective with a log link function, ensuring positive predictions via exponentiation of scores.

Description

The RmseLogLinkRegressionObjective.hpp defines the RmseLogLinkRegressionObjective struct, which implements RMSE (Root Mean Square Error) loss with a log link function instead of the standard identity link. The prediction is computed as exp(score), ensuring all predictions are positive. The metric is (exp(score) - target)^2, and FinishMetric takes the sqrt to convert from MSE to RMSE. The gradient is exp(score) - target (no CalcGradientHessian is provided, making this a gradient-boosting-only objective with k_bHessian=false). GradientConstant and HessianConstant are both 2.0 to account for the derivative factor. Learning rate adjustments of 0.5 are applied for both gradient boosting and differential privacy to align the effective learning rate with the hessian boosting reference point. Target values must be non-negative, non-NaN, and non-infinite.

Usage

Used when the user specifies the "rmse_log" objective for regression with non-negative targets where a log link ensures positive predictions. Suitable for targets that are naturally positive, like prices or quantities.

Code Reference

Source Location

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

Signature

template<typename TFloat> struct RmseLogLinkRegressionObjective : RegressionObjective {
   OBJECTIVE_BOILERPLATE(RmseLogLinkRegressionObjective, MINIMIZE_METRIC,
       Objective_Other, Link_log, false)  // false = no hessian

   inline RmseLogLinkRegressionObjective(const Config& config);
   inline bool CheckRegressionTarget(const double target) const noexcept;
   inline double GradientConstant() const noexcept;    // returns 2.0
   inline double HessianConstant() const noexcept;     // returns 2.0
   inline double FinishMetric(const double metricSum) const noexcept;  // sqrt(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;
};

I/O Contract

Method Formula
CalcMetric (exp(score) - target)^2
CalcGradient exp(score) - target
FinishMetric sqrt(metricSum) -- converts MSE to RMSE

Usage Examples

# Called internally via native bindings
from interpret.glassbox import ExplainableBoostingRegressor
ebm = ExplainableBoostingRegressor(objective="rmse_log")
ebm.fit(X, y)  # Uses RmseLogLinkRegressionObjective for positive predictions

Related Pages

Page Connections

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