code: def test_monotonize():
      data = synthetic_classification()
      X = data["full"]["X"]
      y = data["full"]["y"]
  
      clf = ExplainableBoostingClassifier()
      clf.fit(X, y)
  
      intercept = clf.intercept_
      clf.monotonize(0, increasing=True)
      clf.monotonize(1, increasing=False)
      clf.monotonize(2, increasing="auto")
      clf.monotonize(3)
  
      valid_ebm(clf)
  
      assert (
          abs(
              np.average(
                  clf.term_scores_[0], weights=clf.bin_weights_[0]
              )
          )
          < 0.0001
      )
      assert (
          abs(
              np.average(
                  clf.term_scores_[1], weights=clf.bin_weights_[1]
              )
          )
          < 0.0001
      )
      assert (
          abs(
              np.average(
                  clf.term_scores_[2], weights=clf.bin_weights_[2]
              )
          )
          < 0.0001
      )
      assert (
          abs(
              np.average(
                  clf.term_scores_[3], weights=clf.bin_weights_[3]
              )
          )
          < 0.0001
      )
      assert np.all(np.diff(clf.term_features_[0]) >= 0)
      assert np.all(np.diff(clf.term_features_[1]) <= 0)
      diff = np.diff(clf.term_features_[2])
      assert np.all(diff >= 0) or np.all(diff <= 0)
      assert intercept == clf.intercept_
  
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 6 for calling a global function with example usage: test_monotonize() without return types