code: def test_binarize():
      data = iris_classification()
      X_train = data["train"]["X"]
      y_train = data["train"]["y"]
      X_test = data["test"]["X"]
      y_test = data["test"]["y"]
  
      clf = ExplainableBoostingClassifier(interactions=0)
      clf.fit(X_train, y_train)
  
      # slightly unbalance the EBM so that it is not centered anymore through editing
      clf.term_scores_[0][1, 0] = 10
  
      logloss_multinomial = log_loss(y_test, clf.predict_proba(X_test))
  
      ovr = clf.copy()._ovrize()
      ebms = clf.copy()._binarize()
  
      probas = np.array(
          [ebm.predict_proba(X_test)[:, 1] for ebm in ebms]
      ).T
      probas /= np.sum(probas, axis=-1, keepdims=True)
  
      logloss_binary = log_loss(y_test, probas)
      ratio = logloss_binary / logloss_multinomial
      assert 0.9 < ratio and ratio < 1.1
  
      logloss_ovr = log_loss(y_test, ovr.predict_proba(X_test))
  
      assert math.isclose(logloss_binary, logloss_ovr, rel_tol=1e-5)
  
      original = ovr.copy()._multinomialize()
  
      logloss_original = log_loss(
          y_test, original.predict_proba(X_test)
      )
  
      ratio2 = logloss_original / logloss_multinomial
      assert 0.7 < ratio and ratio < 1.3
  
imports: import math
  from sklearn.metrics import log_loss
  from interpret.utils import make_synthetic
  from ...tutils import synthetic_multiclass, synthetic_classification, iris_classification, smoke_test_explanations
  from ...tutils import synthetic_regression
  from interpret.glassbox import ExplainableBoostingRegressor, ExplainableBoostingClassifier
  from interpret.privacy import DPExplainableBoostingClassifier, DPExplainableBoostingRegressor
  from interpret.utils import inv_link
  from io import StringIO
  import json
  import numpy
  import pandas
  from sklearn.model_selection import train_test_split
  from sklearn.metrics import accuracy_score
  from sklearn.utils.estimator_checks import check_estimator
  import pytest
  import warnings
label_desc: Use image node_id 5 for calling a global function with example usage: test_binarize() without return types