'Inverse the transformation.
Return a vector of size nb_features with the values of Xred assigned
to each group of features
Parameters
Xred : array-like, shape=[n_samples, n_clusters] or [n_clusters,]
The values to be assigned to each cluster of samples
Returns
X : array, shape=[n_samples, n_features] or [n_features]
A vector of size n_samples with the values of Xred assigned to
each of the cluster of samples.'

def inverse_transform(self, Xred):

    check_is_fitted(self, 'labels_')
    (unil, inverse) = np.unique(self.labels_, return_inverse=True)
    return Xred[..., inverse]
