1
import umap.umap_ as umap
#Uniform Manifold Approximation and Projection,find out how distinct our topics are
#https://umap-learn.readthedocs.io/en/latest/
embedding = umap.UMAP(n_neighbors=150, min_dist=0.5,random_state=12).fit_transform(X_topics) 

plt.figure(figsize=(10,8)) 
plt.scatter(embedding[:, 0], 
            embedding[:, 1], 
            c = dataset.target, 
            s = 10, # size 
            edgecolor='none' ) 
plt.show()

ValueError Traceback (most recent call last) in 2 #Uniform Manifold Approximation and Projection,find out how distinct our topics are 3 #https://umap-learn.readthedocs.io/en/latest/ ----> 4 embedding = umap.UMAP(n_neighbors=150, min_dist=0.5,random_state=12).fit_transform(X_topics) 5 6 plt.figure(figsize=(10,8))

ValueError: Buffer has wrong number of dimensions (expected 1, got 2)

  • 1
    1) On what line are you getting the error? 2) If it is on `plt.scatter`, for those of us who aren't familiar with the math, what shape array is returned in `embedding`? 3) What have you done so far to isolate the problem? – Vercingatorix Sep 12 '22 at 14:53
  • It might be helpful if you can provide the entire stack trace and error output. – JerodG Sep 12 '22 at 16:34

0 Answers0