def _get_labels(self, y):
y = np.asarray(y)<EOL>assert y.ndim == <NUM_LIT:1><EOL>labels = np.unique(y).tolist()<EOL>oh = np.zeros((y.size, len(labels)), dtype=float)<EOL>for i, label in enumerate(y):<EOL><INDENT>oh[i, labels.index(label)] = <NUM_LIT:1.><EOL><DEDENT>return oh<EOL>
Construct pylearn2 dataset labels.

Parameters
----------
y : array_like, optional
    Labels.