code: def test_logistic_regression_predict_proba(
      dataset, fit_intercept, sparse_input
  ):
      X_train, X_test, y_train, y_test = dataset
  
      # Assumption needed to avoid qn.h: logistic loss invalid C error.
      assume(set(np.unique(y_train)) == set(np.unique(y_test)))
      num_classes = len(np.unique(y_train))
  
      if sparse_input:
          X_train = csr_matrix(X_train)
          X_test = csr_matrix(X_test)
  
      culog = cuLog(fit_intercept=fit_intercept, output_type="numpy")
      culog.fit(X_train, y_train)
  
      sklog = skLog(
          fit_intercept=fit_intercept,
          **(
              {"solver": "lbfgs", "multi_class": "multinomial"}
              if num_classes > 2
              else {}
          ),
      )
      sklog.coef_ = culog.coef_
      sklog.intercept_ = culog.intercept_ if fit_intercept else 0
      sklog.classes_ = np.arange(num_classes)
  
      cu_proba = culog.predict_proba(X_test)
      sk_proba = sklog.predict_proba(X_test)
  
      cu_log_proba = culog.predict_log_proba(X_test)
      sk_log_proba = sklog.predict_log_proba(X_test)
  
      assert array_equal(cu_proba, sk_proba)
      assert array_equal(cu_log_proba, sk_log_proba)
  
imports: from contextlib import nullcontext
  from distutils.version import LooseVersion
  from functools import lru_cache
  import pytest
  import sklearn
  from cuml.internals.array import elements_in_representable_range
  from cuml.internals.safe_imports import cpu_only_import, cpu_only_import_from, gpu_only_import
  from cuml.testing.strategies import regression_datasets, split_datasets, standard_classification_datasets, standard_regression_datasets
  from cuml.testing.utils import array_difference, array_equal, quality_param, small_classification_dataset, small_regression_dataset, stress_param, unit_param
  from hypothesis import assume, example, given, note
  from hypothesis import strategies
  from hypothesis import target
  from hypothesis.extra.numpy import floating_dtypes
  from sklearn.datasets import load_breast_cancer, load_digits, make_classification, make_regression
  from sklearn.linear_model import LinearRegression
  from sklearn.linear_model import LogisticRegression
  from sklearn.linear_model import Ridge
  from sklearn.model_selection import train_test_split
  from cuml import ElasticNet
  from cuml import LinearRegression
  from cuml import LogisticRegression
  from cuml import Ridge
label_desc: Use image node_id 21 for calling a global function with example usage: test_logistic_regression_predict_proba(dataset, fit_intercept, sparse_input) without return types