code: def test_sklearn_multitask_regression():
      """Test that sklearn models can learn on simple multitask regression."""
      np.random.seed(123)
      n_tasks = 4
      tasks = range(n_tasks)
      dataset = sklearn.datasets.load_diabetes()
      X, y = dataset.data, dataset.target
      y = np.reshape(y, (len(y), 1))
      y = np.hstack([y] * n_tasks)
  
      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.DiskDataset.from_numpy(X_train, y_train)
      test_dataset = dc.data.DiskDataset.from_numpy(X_test, y_test)
  
      regression_metric = dc.metrics.Metric(dc.metrics.r2_score)
  
      def model_builder(model_dir):
          sklearn_model = LinearRegression()
          return dc.models.SklearnModel(sklearn_model, model_dir)
  
      model = dc.models.SingletaskToMultitask(tasks, model_builder)
  
      # Fit trained model
      model.fit(train_dataset)
      model.save()
  
      # Eval model on test
      scores = model.evaluate(test_dataset, [regression_metric])
      score = scores[regression_metric.name]
      assert score > 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 3 for calling a global function with example usage: test_sklearn_multitask_regression() and returns: dc