Implementation:Interpretml Interpret RmseRegressionObjective
| Knowledge Sources | |
|---|---|
| Domains | Machine_Learning, EBM_Core |
| Last Updated | 2026-02-07 12:00 GMT |
Overview
Implements the RMSE (Root Mean Square Error) regression objective, the default and most optimized loss function for regression in EBM.
Description
The RmseRegressionObjective.hpp defines the RmseRegressionObjective struct, which is described as "special" -- it does not use the standard OBJECTIVE_BOILERPLATE macro but instead manually defines all the required constants and static methods. This is because RMSE has unique optimizations: it does not need to store hessians (k_bHessian=false) since the hessian is a constant 2.0, and it does not need approximate math (k_bHasApprox=false) since it uses an identity link function. The CalcMetric and CalcGradient methods are signal-only stubs that will not be called because RMSE uses a custom initialization path (InitializeRmseGradientsAndHessians) that directly computes gradients without scores, and a custom InjectedApplyUpdate. GradientConstant and HessianConstant are both 2.0. FinishMetric currently returns metricSum (MSE) rather than sqrt(metricSum) (RMSE) for cross-platform exactness, since sqrt is not guaranteed to give identical results across platforms.
Usage
The default objective for ExplainableBoostingRegressor. Used automatically when no custom objective is specified for regression tasks. Its special optimizations make it the fastest regression objective in the library.
Code Reference
Source Location
- Repository: Interpretml_Interpret
- File: shared/libebm/compute/objectives/RmseRegressionObjective.hpp
Signature
template<typename TFloat> struct RmseRegressionObjective : RegressionObjective {
using TFloatInternal = TFloat;
static constexpr bool k_bHessian = false;
static constexpr bool k_bHasApprox = false;
static constexpr BoolEbm k_bMaximizeMetric = MINIMIZE_METRIC;
static constexpr ObjectiveEbm k_objective = Objective_Rmse;
static constexpr LinkEbm k_linkFunction = Link_identity;
static ErrorEbm StaticApplyUpdate(const Objective* const pThis,
ApplyUpdateBridge* const pData);
void FillWrapper(const AccelerationFlags zones, void* const pWrapperOut) noexcept;
inline RmseRegressionObjective(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; // returns metricSum (MSE)
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
| Property | Value | Description |
|---|---|---|
| k_bHessian | false | Constant hessian, no per-sample storage needed |
| k_bHasApprox | false | No approximate math (identity link) |
| k_objective | Objective_Rmse | Special RMSE objective identifier |
| k_linkFunction | Link_identity | Direct score-to-prediction mapping |
Usage Examples
# Called internally via native bindings
from interpret.glassbox import ExplainableBoostingRegressor
ebm = ExplainableBoostingRegressor()
ebm.fit(X, y) # Uses RmseRegressionObjective by default for regression