code: def test_sklearn_regression():
      """Test that sklearn models can learn on simple regression datasets."""
      np.random.seed(123)
  
      dataset = sklearn.datasets.load_diabetes()
      X, y = dataset.data, dataset.target
      y = np.expand_dims(y, 1)
      frac_train = 0.7
      n_samples = len(X)
      n_train = int(frac_train * n_samples)
      X_train, y_train = X[:n_train], y[:n_train]
      X_test, y_test = X[n_train:], y[n_train:]
      train_dataset = dc.data.NumpyDataset(X_train, y_train)
      test_dataset = dc.data.NumpyDataset(X_test, y_test)
  
      regression_metric = dc.metrics.Metric(dc.metrics.r2_score)
  
      sklearn_model = LinearRegression()
      model = dc.models.SklearnModel(sklearn_model)
  
      # Fit trained model
      model.fit(train_dataset)
      model.save()
  
      # Eval model on test
      scores = model.evaluate(test_dataset, [regression_metric])
      assert scores[regression_metric.name] > 0.5
  
file_path: deepchem/deepchem/models/tests/test_sklearn_model.py
imports: import sklearn
  import sklearn.datasets
  import numpy
  import deepchem
  from sklearn.linear_model import LinearRegression
  from sklearn.linear_model import LogisticRegression
label_desc: Use image node_id 1 for calling a global function with example usage: test_sklearn_regression() without return types