MCPcopy Create free account
hub / github.com/ddbourgin/numpy-ml / __init__

Method __init__

numpy_ml/preprocessing/general.py:55–67  ·  view source on GitHub ↗

Convert between category labels and their one-hot vector representations. Parameters ---------- categories : list of length `C` List of the unique category labels for the items to encode.

(self)

Source from the content-addressed store, hash-verified

53
54class OneHotEncoder:
55 def __init__(self):
56 """
57 Convert between category labels and their one-hot vector
58 representations.
59
60 Parameters
61 ----------
62 categories : list of length `C`
63 List of the unique category labels for the items to encode.
64 """
65 self._is_fit = False
66 self.hyperparameters = {}
67 self.parameters = {"categories": None}
68
69 def __call__(self, labels):
70 return self.transform(labels)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected