def inverse_transform(self, X):
    'Transform data back to its original space.\n\n        In other words, return an input `X_original` whose transform would be X.\n\n        Parameters\n        ----------\n        X : array-like of shape (n_samples, n_components)\n            New data, where `n_samples` is the number of samples\n            and `n_components` is the number of components.\n\n        Returns\n        -------\n        X_original array-like of shape (n_samples, n_features)\n            Original data, where `n_samples` is the number of samples\n            and `n_features` is the number of features.\n\n        Notes\n        -----\n        If whitening is enabled, inverse_transform will compute the\n        exact inverse operation, which includes reversing whitening.\n        '
    if self.whiten:
        return (np.dot(X, (np.sqrt(self.explained_variance_[:, np.newaxis]) * self.components_)) + self.mean_)
    else:
        return (np.dot(X, self.components_) + self.mean_)
Transform data back to its original space.

In other words, return an input `X_original` whose transform would be X.

Parameters
----------
X : array-like of shape (n_samples, n_components)
    New data, where `n_samples` is the number of samples
    and `n_components` is the number of components.

Returns
-------
X_original array-like of shape (n_samples, n_features)
    Original data, where `n_samples` is the number of samples
    and `n_features` is the number of features.

Notes
-----
If whitening is enabled, inverse_transform will compute the
exact inverse operation, which includes reversing whitening.
def inverse_transform(self, X):
    'Transform data back to its original space.\n\n        In other words, return an input `X_original` whose transform would be X.\n\n        Parameters\n        ----------\n        X : array-like of shape (n_samples, n_components)\n            New data, where `n_samples` is the number of samples\n            and `n_components` is the number of components.\n\n        Returns\n        -------\n        X_original array-like of shape (n_samples, n_features)\n            Original data, where `n_samples` is the number of samples\n            and `n_features` is the number of features.\n\n        Notes\n        -----\n        If whitening is enabled, inverse_transform will compute the\n        exact inverse operation, which includes reversing whitening.\n        '
    if self.whiten:
        return (np.dot(X, (np.sqrt(self.explained_variance_[:, np.newaxis]) * self.components_)) + self.mean_)
    else:
        return (np.dot(X, self.components_) + self.mean_)