code: def test_initialize_class_weights_binary_imbalanced(self):
      sub_train = random_text_classification_dataset(10)
      sub_train.y = np.array([0] * 2 + [1] * 8)
  
      classifier = PytorchClassifierImplementation(
          2, class_weight="balanced"
      )
      class_weights = classifier.initialize_class_weights(sub_train)
  
      expected_weights = torch.FloatTensor([4.0, 1.0])
  
      self.assertTrue(
          torch.equal(expected_weights.cpu(), class_weights.cpu())
      )
  
imports: import unittest
  import pytest
  import torch
  import numpy
  from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
label_desc: Use image node_id 6 for calling the PytorchClassifierTest obj's underlying member method code with example usage: obj.test_initialize_class_weights_binary_imbalanced() without return types