Skip to content

Commit

Permalink
rename Objective_Unknown -> Objective_Other
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbkoch committed Dec 9, 2024
1 parent 3084304 commit bd005ec
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions python/interpret-core/interpret/utils/_native.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Native:
Task_MulticlassPlus = 3

# Objectives
Objective_Unknown = 0
Objective_Other = 0
Objective_MonoClassification = 1
Objective_LogLossBinary = 2
Objective_LogLossMulticlass = 3
Expand Down Expand Up @@ -830,7 +830,7 @@ def determine_task(self, objective):
return task.decode("ascii")

def determine_link(self, flags, objective, n_classes):
objective_code = ct.c_int32(0)
objective_code = ct.c_int32(Native.Objective_Other)
link = ct.c_int32(0)
link_param = ct.c_double(np.nan)

Expand Down
6 changes: 3 additions & 3 deletions shared/libebm/DetermineLinkFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ EBM_API_BODY ErrorEbm EBM_CALLING_CONVENTION DetermineLinkFunction(LinkFlags fla
LOG_0(Trace_Error, "ERROR DetermineLinkFunction GetObjective failed");

if(nullptr != objectiveOut) {
*objectiveOut = Objective_Unknown;
*objectiveOut = Objective_Other;
}
if(nullptr != linkOut) {
*linkOut = Link_Unknown;
Expand All @@ -126,7 +126,7 @@ EBM_API_BODY ErrorEbm EBM_CALLING_CONVENTION DetermineLinkFunction(LinkFlags fla
LOG_0(Trace_Error, "ERROR DetermineLinkFunction cClasses mismatch to objective");

if(nullptr != objectiveOut) {
*objectiveOut = Objective_Unknown;
*objectiveOut = Objective_Other;
}
if(nullptr != linkOut) {
*linkOut = Link_Unknown;
Expand All @@ -140,7 +140,7 @@ EBM_API_BODY ErrorEbm EBM_CALLING_CONVENTION DetermineLinkFunction(LinkFlags fla
LOG_0(Trace_Error, "ERROR DetermineLinkFunction cClasses cannot be zero");

if(nullptr != objectiveOut) {
*objectiveOut = Objective_Unknown;
*objectiveOut = Objective_Other;
}
if(nullptr != linkOut) {
*linkOut = Link_Unknown;
Expand Down
2 changes: 1 addition & 1 deletion shared/libebm/bridge/bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ struct ObjectiveWrapper {
inline static void InitializeObjectiveWrapperUnfailing(ObjectiveWrapper* const pObjectiveWrapper) {
pObjectiveWrapper->m_pObjective = NULL;
pObjectiveWrapper->m_bMaximizeMetric = EBM_FALSE;
pObjectiveWrapper->m_objective = Objective_Unknown;
pObjectiveWrapper->m_objective = Objective_Other;
pObjectiveWrapper->m_linkFunction = Link_Unknown;
pObjectiveWrapper->m_linkParam = 0.0;
pObjectiveWrapper->m_learningRateAdjustmentDifferentialPrivacy = 0.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ template<typename TFloat> struct ExampleRegressionObjective : RegressionObjectiv
// - this class type
// - MINIMIZE_METRIC or MAXIMIZE_METRIC determines which direction the metric should go for early stopping
// - Link function type. See libebm.h for a list of available link functions
OBJECTIVE_BOILERPLATE(ExampleRegressionObjective, MINIMIZE_METRIC, Objective_Unknown, Link_identity, true)
OBJECTIVE_BOILERPLATE(ExampleRegressionObjective, MINIMIZE_METRIC, Objective_Other, Link_identity, true)

// member variables should be of type TFloat
TFloat m_param0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// TFloat is a datatype that could hold inside a double, float, or some SIMD intrinsic type.
// See cpu_64.cpp, avx2_32.cpp, and cuda_32.cu as examples where TFloat operators are defined.
template<typename TFloat> struct GammaDevianceRegressionObjective : RegressionObjective {
OBJECTIVE_BOILERPLATE(GammaDevianceRegressionObjective, MINIMIZE_METRIC, Objective_Unknown, Link_log, true)
OBJECTIVE_BOILERPLATE(GammaDevianceRegressionObjective, MINIMIZE_METRIC, Objective_Other, Link_log, true)

inline GammaDevianceRegressionObjective(const Config& config) {
if(config.cOutputs != 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// TFloat is a datatype that could hold inside a double, float, or some SIMD intrinsic type.
// See cpu_64.cpp, avx2_32.cpp, and cuda_32.cu as examples where TFloat operators are defined.
template<typename TFloat> struct PoissonDevianceRegressionObjective : RegressionObjective {
OBJECTIVE_BOILERPLATE(PoissonDevianceRegressionObjective, MINIMIZE_METRIC, Objective_Unknown, Link_log, true)
OBJECTIVE_BOILERPLATE(PoissonDevianceRegressionObjective, MINIMIZE_METRIC, Objective_Other, Link_log, true)

// The constructor parameters following config must match the RegisterObjective parameters in
// objective_registrations.hpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// TFloat is a datatype that could hold inside a double, float, or some SIMD intrinsic type.
// See cpu_64.cpp, avx2_32.cpp, and cuda_32.cu as examples where TFloat operators are defined.
template<typename TFloat> struct PseudoHuberRegressionObjective : RegressionObjective {
OBJECTIVE_BOILERPLATE(PseudoHuberRegressionObjective, MINIMIZE_METRIC, Objective_Unknown, Link_identity, true)
OBJECTIVE_BOILERPLATE(PseudoHuberRegressionObjective, MINIMIZE_METRIC, Objective_Other, Link_identity, true)

TFloat m_deltaInverted;
double m_deltaSquared;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// TFloat is a datatype that could hold inside a double, float, or some SIMD intrinsic type.
// See cpu_64.cpp, avx2_32.cpp, and cuda_32.cu as examples where TFloat operators are defined.
template<typename TFloat> struct RmseLogLinkRegressionObjective : RegressionObjective {
OBJECTIVE_BOILERPLATE(RmseLogLinkRegressionObjective, MINIMIZE_METRIC, Objective_Unknown, Link_log, false)
OBJECTIVE_BOILERPLATE(RmseLogLinkRegressionObjective, MINIMIZE_METRIC, Objective_Other, Link_log, false)

inline RmseLogLinkRegressionObjective(const Config& config) {
if(config.cOutputs != 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// TFloat is a datatype that could hold inside a double, float, or some SIMD intrinsic type.
// See cpu_64.cpp, avx2_32.cpp, and cuda_32.cu as examples where TFloat operators are defined.
template<typename TFloat> struct TweedieDevianceRegressionObjective : RegressionObjective {
OBJECTIVE_BOILERPLATE(TweedieDevianceRegressionObjective, MINIMIZE_METRIC, Objective_Unknown, Link_log, true)
OBJECTIVE_BOILERPLATE(TweedieDevianceRegressionObjective, MINIMIZE_METRIC, Objective_Other, Link_log, true)

TFloat m_variancePowerParamSub1;
TFloat m_variancePowerParamSub2;
Expand Down
2 changes: 1 addition & 1 deletion shared/libebm/inc/libebm.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ typedef struct _InteractionHandle {
#define Task_BinaryClassification (TASK_CAST(2)) // 2 classes
#define Task_MulticlassPlus (TASK_CAST(3)) // 3+ classes (the value is the # of classes)

#define Objective_Unknown (OBJECTIVE_CAST(0))
#define Objective_Other (OBJECTIVE_CAST(0))
#define Objective_MonoClassification (OBJECTIVE_CAST(1))
#define Objective_LogLossBinary (OBJECTIVE_CAST(2))
#define Objective_LogLossMulticlass (OBJECTIVE_CAST(3))
Expand Down

0 comments on commit bd005ec

Please sign in to comment.