code: def test_grid_search(self):
      def scorer(network, X, y):
          y = asfloat(y)
          result = asfloat(network.predict(X))
          return self.eval(objectives.rmsle(result[:, 0], y))
  
      dataset = datasets.load_diabetes()
      x_train, x_test, y_train, y_test = train_test_split(
          dataset.data, dataset.target, test_size=0.3
      )
  
      grnnet = algorithms.GRNN(std=0.5, verbose=False)
      grnnet.train(x_train, y_train)
      error = scorer(grnnet, x_test, y_test)
  
      self.assertAlmostEqual(0.513, error, places=3)
  
      random_search = model_selection.RandomizedSearchCV(
          grnnet,
          param_distributions={"std": np.arange(1e-2, 0.1, 1e-4)},
          n_iter=10,
          scoring=scorer,
          random_state=self.random_seed,
          cv=3,
      )
      random_search.fit(dataset.data, dataset.target)
      scores = random_search.cv_results_
  
      best_score = min(scores["mean_test_score"])
      self.assertAlmostEqual(0.4266, best_score, places=3)
  
file_path: neupy/tests/compatibilities/test_sklearn_compatibility.py
imports: import numpy
  from sklearn import datasets, preprocessing, model_selection
  from sklearn.model_selection import train_test_split
  from sklearn.pipeline import Pipeline
  from neupy import algorithms, layers
  from neupy.utils import asfloat
  from neupy.algorithms.gd import objectives
  from base import BaseTestCase
label_desc: Use image node_id 2 for calling the SklearnCompatibilityTestCase obj's underlying member method code with example usage: obj.test_grid_search() and returns: self