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 DetermineLinkFunction

From Leeroopedia


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

Overview

DetermineLinkFunction is a C++ module that resolves objective function strings into their corresponding link functions, task types, and configuration parameters for EBM models.

Description

This module provides several public EBM API functions that form the bridge between user-specified objective strings (e.g., "logit", "log", "identity") and the internal link function enumerations used by the EBM engine. Key functions include:

  • DetermineTask: Given an objective string, resolves the corresponding machine learning task type (classification, regression, or ranking).
  • DetermineLinkFunction: Given an objective string and class count, resolves the full link function configuration including the link type, link parameter, whether hessians are used, and the objective enum.
  • GetLinkFunctionStr: Converts a LinkEbm enum value to its string representation.
  • GetLinkFunctionInt: Converts a link function string to its LinkEbm enum value, using forgiving string comparison (case-insensitive, whitespace-tolerant).
  • GetTaskStr / GetTaskInt: Convert between task type enums and strings.

The module supports a comprehensive set of link functions: logit, probit, cloglog, loglog, cauchit, power, identity, log, inverse, inverse_square, sqrt, and their multiclass/OVR variants (mlogit, vlogit). It also handles custom objective types for regression, binary classification, and multiclass classification.

Usage

This module is called early in the EBM pipeline to resolve user-specified objective strings before creating boosting or interaction cores. The Python API calls DetermineLinkFunction to validate the objective and obtain the link function, which determines how raw scores are transformed into predictions.

Code Reference

Source Location

Signature

EBM_API_BODY ErrorEbm EBM_CALLING_CONVENTION DetermineTask(
    const char* objective,
    TaskEbm* taskOut);

EBM_API_BODY ErrorEbm EBM_CALLING_CONVENTION DetermineLinkFunction(
    LinkFlags flags,
    const char* objective,
    IntEbm countClasses,
    ObjectiveEbm* objectiveOut,
    BoolEbm* isHessian,
    LinkEbm* linkOut,
    double* linkParamOut);

EBM_API_BODY const char* EBM_CALLING_CONVENTION GetLinkFunctionStr(
    LinkEbm link);

EBM_API_BODY LinkEbm EBM_CALLING_CONVENTION GetLinkFunctionInt(
    const char* link);

EBM_API_BODY const char* EBM_CALLING_CONVENTION GetTaskStr(
    TaskEbm task);

EBM_API_BODY TaskEbm EBM_CALLING_CONVENTION GetTaskInt(
    const char* task);

I/O Contract

Inputs

Name Type Required Description
flags LinkFlags Yes Configuration flags (e.g., BinaryAsMulticlass, DifferentialPrivacy)
objective const char* Yes Objective function name string (e.g., "log_loss", "rmse")
countClasses IntEbm Yes Number of target classes (for classification tasks)

Outputs

Name Type Description
return value ErrorEbm Error code (Error_None on success)
objectiveOut ObjectiveEbm* Resolved objective enum value
isHessian BoolEbm* Whether the objective uses second-order hessian information
linkOut LinkEbm* Resolved link function enum value
linkParamOut double* Link function parameter (e.g., power for Power link)

Usage Examples

Pipeline Context

# This C++ module is called internally via the native bindings
# to resolve the objective string and link function
from interpret.glassbox import ExplainableBoostingClassifier
ebm = ExplainableBoostingClassifier()
# Internally calls DetermineLinkFunction to resolve "log_loss" -> Link_logit
ebm.fit(X, y)

Related Pages

Page Connections

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