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)
| 53 | |
| 54 | class 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) |
nothing calls this directly
no outgoing calls
no test coverage detected