class_docstr: Test the OHE vector encoder
  
  NOTE, this is sensitive to the mapping of enc.map. If your unit-tests are failing, check to see if the enc.map order matches what the encoded_data should be; this is based on the mapped-place. Using np.unique() inadvertently sorts the data neatly, hence allowing an intuitive place of which order each category is.
class_docstr_tok: ["Test","the","OHE","vector","encoder","NOTE",",","this","is","sensitive","to","the","mapping","of","enc.map",".","If","your","unit-tests","are","failing",",","check","to","see","if","the","enc.map","order","matches","what","the","encoded_data","should","be",";","this","is","based","on","the","mapped-place",".","Using","np.unique","(",")","inadvertently","sorts","the","data","neatly",",","hence","allowing","an","intuitive","place","of","which","order","each","category","is","."]
docstr: Tests edge cause where target weights have a 0 weight which is unacceptable for downstream processing (inverse weights will 1/0)
docstr_tok: ["Tests","edge","cause","where","target","weights","have","a","0","weight","which","is","unacceptable","for","downstream","processing","(","inverse","weights","will","1\/0",")"]
code: def test_distro_zero(self):
      """
      Tests edge cause where target weights have a 0 weight which is unacceptable for downstream processing (inverse weights will 1/0)
      """  # noqa
      data = ["apple", "apple", "banana", "apple", "apple", "orange"]
  
      # Arbitrary weights (ex: number of examples)
      tweights = {"apple": 100, "banana": 1, "orange": 0}
  
      enc = OneHotEncoder(
          use_unknown=False, is_target=True, target_weights=tweights
      )
  
      # Check if 0-weight class is rejected
      self.assertRaises(ValueError, enc.prepare, data)
  
file_path: lightwood/tests/unit_tests/encoder/categorical/test_onehot.py
imports: import unittest
  import torch
  from torch import Tensor
  import numpy
  from lightwood.encoder.categorical.onehot import OneHotEncoder
  from lightwood.helpers.constants import _UNCOMMON_WORD
label_desc: Use image node_id 7 for calling the TestOnehot obj's underlying member method code with example usage: obj.test_distro_zero() without return types