Add a warning message as per to make errors more interpretable.
@@ -2178,6 +2178,11 @@ class UMAP(BaseEstimator):
raise ValueError("Inverse transform not available for sparse input.")
elif self._inverse_distance_func is None:
raise ValueError("Inverse transform not available for given metric.")
+ elif self.n_components >= 8:
+ warn("Inverse transform works best with low dimensional embeddings."
+ " Results may be poor, or this approach to inverse transform"
+ " may fail altogether! If you need a high dimensional latent space"
+ " and inverse transform operations consider using an autoencoder.")
X = check_array(X, dtype=np.float32, order="C")
random_state = check_random_state(self.transform_seed)
