code: def test_ebm_scale():
      data = synthetic_regression()
      X = data["full"]["X"]
      y = data["full"]["y"]
  
      clf = ExplainableBoostingRegressor(n_jobs=-2, interactions=0)
      clf.fit(X, y)
      assert clf.term_names_ == ["A", "B", "C", "D"]
  
      # the synthetic dataset is random and if no progress is made
      # during boosting it can have zeros, so force to non-zero
      clf.term_scores_[0][1] = 99.0
      clf.term_scores_[1][1] = 99.0
      clf.term_scores_[2][1] = 99.0
      clf.term_scores_[3][1] = 99.0
  
      # The following is equivalent to calling `clf.remove_terms(["A", "C"])`
      clf.scale(0, factor=0)
      clf.scale("B", factor=0.5)
      clf.scale("C", factor=0)
      clf.scale(3, factor=2.0)
      clf.sweep()
      assert clf.term_names_ == ["B", "D"]
      assert len(clf.term_features_) == 2
      assert len(clf.term_names_) == 2
      assert len(clf.term_scores_) == 2
      assert len(clf.bagged_scores_) == 2
      assert len(clf.bagged_intercept_) == len(clf.bagged_scores_[0])
      assert len(clf.standard_deviations_) == 2
      assert len(clf.bin_weights_) == 2
  
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 50 for calling a global function with example usage: test_ebm_scale() without return types