简体   繁体   中英

Buffer has wrong number of dimensions (expected 1, got 2). How to fit the dimensions problem?

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)

I have the same issue. I downloaded the source code and ran it locally to try and debug it, but wierdly enough, the local version worked smoothly. You can try that if you want a quick fix. No idea on what is actually happening though...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM