Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the init_score in EBM Classifier #541

Open
emrynHofmannElephant opened this issue May 14, 2024 · 1 comment
Open

Using the init_score in EBM Classifier #541

emrynHofmannElephant opened this issue May 14, 2024 · 1 comment

Comments

@emrynHofmannElephant
Copy link

Hi,

I'm trying to use the init_score parameter to offset a binary classification EBM by a couple of features using another EBM.

EBM_offset -> EBM_main

How should I use the predictions from the EBM_offset to create the init_score for the EBM_main?
Currently we're using:

X_train["init_score"] = EBM_offset.predict_proba(X_train)[:,1]

However, we were wondering if this is the right approach?
Alternatively we've considered using

preds = EBM_offset.predict_proba(X_train[offset_features])[:,1]
X_train["init_score"] = np.log(preds/(1-preds))

Which is the correct usage? - Or is there a better method to use?

@paulbkoch
Copy link
Collaborator

The decision_function returns raw scores, so an easy way to do this is:

init_scores = EBM_offset.decision_function(X)
probs = EBM_main.predict_proba(X, init_scores)

Or, if you prefer, you can merge the two models. This is more complicated, but there's a related example in:
https://interpret.ml/docs/python/examples/custom-interactions.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants