'Transform the given label sets
Parameters
y : iterable of iterables
A set of labels (any orderable and hashable object) for each
sample. If the `classes` parameter is set, `y` will not be
iterated.
Returns
y_indicator : array or CSR matrix, shape (n_samples, n_classes)
A matrix such that `y_indicator[i, j] = 1` iff `classes_[j]` is in
`y[i]`, and 0 otherwise.'

def transform(self, y):

    check_is_fitted(self, 'classes_')
    class_to_index = dict(zip(self.classes_, range(len(self.classes_))))
    yt = self._transform(y, class_to_index)
    if (not self.sparse_output):
        yt = yt.toarray()
    return yt
