code: def test_regressor_uncertainty(ru_params):
      uncertainty_type = ru_params
      if uncertainty_type == "dropout":
          model = nn.Sequential(
              nn.Linear(n_features, 10),
              nn.Dropout(0.5),
              nn.Linear(10, 1),
          )
      else:
          model = nn.Linear(n_features, 42)
  
      def model_fn(x):
          with torch.no_grad():
              return np.array(model(torch.as_tensor(x)))
  
      uncertainties = regressor_uncertainty(
          X_test, model_fn, uncertainty_type=uncertainty_type
      )
      assert uncertainties.shape == (X_test.shape[0], 1)
  
file_path: alibi-detect/alibi_detect/cd/tests/test_preprocess.py
imports: from itertools import product
  import numpy
  import pytest
  import torch.nn
  import torch
  from sklearn.linear_model import LogisticRegression
  from alibi_detect.cd.preprocess import classifier_uncertainty, regressor_uncertainty
label_desc: Use image node_id 4 for calling a global function with example usage: test_regressor_uncertainty(ru_params) and returns: np