docstr: Test that a 2D CNN can overfit simple classification datasets.
docstr_tok: ["Test","that","a","2D","CNN","can","overfit","simple","classification","datasets","."]
code: def test_2d_cnn_classification(self):
      """Test that a 2D CNN can overfit simple classification datasets."""
      n_samples = 10
      n_features = 3
      n_tasks = 1
  
      np.random.seed(123)
      X = np.random.rand(n_samples, 10, 10, n_features)
      y = np.random.randint(2, size=(n_samples, n_tasks)).astype(
          np.float32
      )
      dataset = dc.data.NumpyDataset(X, y)
  
      classification_metric = dc.metrics.Metric(
          dc.metrics.roc_auc_score
      )
      model = dc.models.CNN(
          n_tasks,
          n_features,
          dims=2,
          dropouts=0,
          kernel_size=3,
          mode="classification",
          learning_rate=0.003,
      )
  
      # Fit trained model
      model.fit(dataset, nb_epoch=100)
  
      # Eval model on train
      scores = model.evaluate(dataset, [classification_metric])
      assert scores[classification_metric.name] > 0.9
  
file_path: deepchem/deepchem/models/tests/test_cnn.py
imports: import deepchem
  import numpy
  import pytest
  import unittest
  from flaky import flaky
label_desc: Use image node_id 2 for calling the TestCNN obj's underlying member method code with example usage: obj.test_2d_cnn_classification() without return types