code: def test_isotonic_calibration_fit_predict():
      # Some tests for the multi-class case
      x_train = np.array([[1, 1], [2, 3.5]])
      y_train = np.array([[0.9, 0.1], [0.2, 0.8]])
  
      ic = IsotonicCalibration()
  
      assert len(ic.regressors) == 0
  
      ic.fit(x_train=x_train, y_train=y_train)
  
      assert ic.n_classes == 2
  
      # Check that predict returns data of the same dimensionality as
      # the training data.
      x_test = np.array([[0, 1]])
      y_pred = ic.predict(x=x_test)
  
      assert y_pred.shape == (1, 2)
      assert np.sum(y_pred) == pytest.approx(1.0)
  
      # Some tests for the binary classification case.
      x_train = np.array([0.1, 0.5, 0.2])
      y_train = np.array([0.2, 0.55, 0.3])
  
      ic = IsotonicCalibration()
  
      assert len(ic.regressors) == 0
  
      ic.fit(x_train=x_train, y_train=y_train)
  
      assert ic.n_classes == 1
  
      # Check that predict returns data of the same dimensionality as
      # the training data.
      x_test = np.array([0.5, 0.1])
      y_pred = ic.predict(x=x_test)
  
      assert y_pred.shape == (2, 1)
  
file_path: stellargraph/tests/test_calibration.py
imports: import pytest
  import numpy
  from stellargraph.calibration import *
label_desc: Use image node_id 4 for calling a global function with example usage: test_isotonic_calibration_fit_predict() without return types