code: def test_sparse_data_validation_for_regression():
      X, y = sklearn.datasets.make_regression(
          n_samples=100, n_features=50, random_state=0
      )
      X_sp = sparse.coo_matrix(X)
      validator = InputValidator(is_classification=False)
  
      validator.fit(X_train=X_sp, y_train=y)
  
      X_t, y_t = validator.transform(X, y)
      assert np.shape(X) == np.shape(X_t)
  
      # make sure everything was encoded to number
      assert np.issubdtype(X_t.dtype, np.number)
      assert np.issubdtype(y_t.dtype, np.number)
  
      # Make sure we can change the sparse format
      X_t, y_t = validator.transform(sparse.csr_matrix(X), y)
  
file_path: auto-sklearn/test/test_data/test_validation.py
imports: import numpy
  import pandas
  import sklearn.datasets
  import sklearn.model_selection
  from scipy import sparse
  from autosklearn.data.validation import InputValidator
  import pytest
label_desc: Use image node_id 3 for calling a global function with example usage: test_sparse_data_validation_for_regression() without return types