NumPy allowed · plain Python earns 10 bonus points
Computed matrix × vector transformation
Transform integer class label vectors into vectorized binary one-hot matrices using NumPy.
Implement vectorized_one_hot(labels, num_classes). Given integer labels $0 \le \text{label} < \text{num\_classes}$, construct a 2D binary matrix of shape (len(labels), num_classes) where entry [i][labels[i]] = 1 and all others are 0. Return as a list of integer lists.
vectorized_one_hot(labels: list[int], num_classes: int) -> list[list[int]]