'Transform array or sparse matrix X back to feature mappings.
X must have been produced by this DictVectorizer\'s transform or
fit_transform method; it may only have passed through transformers
that preserve the number of features and their order.
In the case of one-hot/one-of-K coding, the constructed feature
names and values are returned rather than the original ones.
Parameters
X : {array-like, sparse matrix}, shape = [n_samples, n_features]
Sample matrix.
dict_type : callable, optional
Constructor for feature mappings. Must conform to the
collections.Mapping API.
Returns
D : list of dict_type objects, length = n_samples
Feature mappings for the samples in X.'

def inverse_transform(self, X, dict_type=dict):

    X = check_array(X, accept_sparse=['csr', 'csc'])
    n_samples = X.shape[0]
    names = self.feature_names_
    dicts = [dict_type() for _ in xrange(n_samples)]
    if sp.issparse(X):
        for (i, j) in zip(*X.nonzero()):
            dicts[i][names[j]] = X[(i, j)]
    else:
        for (i, d) in enumerate(dicts):
            for (j, v) in enumerate(X[i, :]):
                if (v != 0):
                    d[names[j]] = X[(i, j)]
    return dicts
