class_docstr: Test that support generation happens properly.
class_docstr_tok: ["Test","that","support","generation","happens","properly","."]
docstr: Tests that examples with zero weight are removed.
docstr_tok: ["Tests","that","examples","with","zero","weight","are","removed","."]
code: def test_remove_dead_examples(self):
      """Tests that examples with zero weight are removed."""
      n_samples = 100
      n_features = 3
      n_tasks = 1
  
      # Generate dummy dataset
      np.random.seed(123)
      p = 0.05
      ids = np.arange(n_samples)
      X = np.random.rand(n_samples, n_features)
      y = np.random.binomial(1, p, size=(n_samples, n_tasks))
      w = np.random.binomial(1, p, size=(n_samples, n_tasks))
  
      num_nonzero = np.count_nonzero(np.sum(w, axis=1))
  
      dataset = dc.data.NumpyDataset(X, y, w, ids)
  
      cleared_dataset = dc.data.remove_dead_examples(dataset)
      assert len(cleared_dataset) == num_nonzero
  
file_path: deepchem/deepchem/data/tests/test_support_generator.py
imports: import logging
  import numpy
  import unittest
  import deepchem
label_desc: Use image node_id 1 for calling the TestSupports obj's underlying member method code with example usage: obj.test_remove_dead_examples() without return types