class_docstr: Test the OHE vector encoder 
docstr: Tests if target weights do not sum to 1 properly handled.
  
  This handles cases where people may choose 1/class_size for weights
docstr_tok: ["Tests","if","target","weights","do","not","sum","to","1","properly","handled",".","This","handles","cases","where","people","may","choose","1\/class_size","for","weights"]
code: def test_distro_nonzeroweights(self):
      """
      Tests if target weights do not sum to 1 properly handled.
  
      This handles cases where people may choose 1/class_size for weights
      """
      data = ["apple", "apple", "orange", "apple", "apple", "orange"]
      tweights = {"apple": 100, "orange": 5000}
  
      enc = BinaryEncoder(is_target=True, target_weights=tweights)
      enc.prepare(data)
  
      # Get the ground-truth weights
      iweights = torch.ones(size=(len(tweights),))
      for key, value in tweights.items():  # accounts for order
          iweights[enc.map[key]] = value
  
      self.assertTrue(
          np.all(((enc.index_weights - iweights) == 0).tolist())
      )
  
file_path: lightwood/tests/unit_tests/encoder/categorical/test_binary.py
imports: import unittest
  import torch
  from torch import Tensor
  import numpy
  from lightwood.encoder.categorical.binary import BinaryEncoder
  from lightwood.helpers.constants import _UNCOMMON_WORD
label_desc: Use image node_id 5 for calling the TestBinary obj's underlying member method code with example usage: obj.test_distro_nonzeroweights() without return types