code: def test_compute_model_performance_singletask_classifier():
      """Computes model performance on singletask dataset with one-hot label encoding."""
      n_data_points = 20
      n_features = 10
  
      X = np.ones(shape=(int(n_data_points / 2), n_features)) * -1
      X1 = np.ones(shape=(int(n_data_points / 2), n_features))
      X = np.concatenate((X, X1))
      class_1 = np.array(
          [[0.0, 1.0] for x in range(int(n_data_points / 2))]
      )
      class_0 = np.array(
          [[1.0, 0.0] for x in range(int(n_data_points / 2))]
      )
      y = np.concatenate((class_0, class_1))
      dataset = NumpyDataset(X, y)
  
      features = layers.Input(shape=(n_features,))
      dense = layers.Dense(2)(features)
      output = layers.Softmax()(dense)
      keras_model = tf.keras.Model(inputs=features, outputs=[output])
      model = dc.models.KerasModel(
          keras_model,
          dc.models.losses.SoftmaxCrossEntropy(),
          learning_rate=0.1,
      )
  
      model.fit(dataset, nb_epoch=1000)
      metric = dc.metrics.Metric(
          dc.metrics.roc_auc_score,
          np.mean,
          mode="classification",
          n_tasks=1,
      )
  
      scores = model.evaluate_generator(
          model.default_generator(dataset),
          [metric],
          per_task_metrics=True,
      )
      scores = list(scores[1].values())
      assert np.isclose(scores, [1.0], atol=0.05)
  
file_path: deepchem/deepchem/utils/test/test_generator_evaluator.py
imports: import numpy
  from flaky import flaky
  import pytest
  import deepchem
  from deepchem.data import NumpyDataset
label_desc: Use image node_id 2 for calling a global function with example usage: test_compute_model_performance_singletask_classifier() without return types