Comments (23)
I also had the same issue (import umap; umap.UMAP
returns AttributeError: module 'umap' has no attribute 'UMAP'
) (MacOS, High Sierra, installed via pip).
As a workaround import umap.umap_ as umap
seems to work instead of import umap
from umap.
Hi, I can't say for sure but potentially it may be that you actually have the wrong umap. Due to name collisions the UMAP algorithm code is under the name umap-learn
on PyPI so if you did
pip install umap
you will get a different package that does not to what you want.
If that is the case then you'll want
pip uninstall umap
pip install umap-learn
If that is not the problem then there is something else wrong that is going to be harder to diagnose. Either way, please let me know, and sorry about the naming confusion on pip.
from umap.
I encountered this error due to having named my python-file umap.py. Felt quite silly and changed filename, which solved the problem.
from umap.
Actually, I have used the following:
pip uninstall umap
pip install umap-learn
Now on the notebook:
import umap.umap_ as umap
reducer=umap.UMAP()
It works well.
from umap.
I was facing the same problem too, I'm suing windows, conda versions, and what i did is that
pip uninstall umap-learn
pip install umap-learn
and then follow it
pip install umap
it just worked !
from umap.
The best I can offer is that you need to make sure that the mapping based umap
package has been completely purged from your python install before trying to install umap-learn
. I would suggest finding the relevant site-packages
directory and removing any and all files and directories there that start with umap
and then trying to re-install umap-learn
.
from umap.
I just encountered this common problem today. Working from within a Jupyter Notebook I performed:
!pip install umap
Then
import umap
reducer = umap.UMAP()
caused the common error here. I installed 'umap-learn' but to no avail.
I corrected the issue by uninstalling 'umap', then also uninstalling 'umap-learn', then reinstalling 'umap-learn' and restarting my kernel:
!pip uninstall umap
!pip uninstall umap-learn
!pip install umap-learn
With this solution, I was then successful with:
import umap
reducer = umap.UMAP()
from umap.
I also had the same issue (
import umap; umap.UMAP
returnsAttributeError: module 'umap' has no attribute 'UMAP'
) (MacOS, High Sierra, installed via pip).As a workaround
import umap.umap_ as umap
seems to work instead ofimport umap
This seemed to get me around the original error (after also switching to installing umap-learn instead), but then my kernel died on attempting umap.UMAP().fit_transform().
(Datalab running on a Google Cloud Dataproc cluster)
from umap.
I am getting this problem too now upon my very first attempt to use UMAP. :(
I have taken care to only install umap-learn
and not umap
to begin with. The import umap.umap_ as umap
workaround fails too.
Running from a Jupyter notebook with python 3.6 on an Ubuntu machine.
from umap.
Thanks for your excellent work on this package @lmcinnes . I know the problem is not related to the package itself, but just wanted to document it for tracking purposes. FYI I also ran into the same issue yesterday. I think I installed the other umap
first then figured out that umap-learn
was the right choice. After uninstalling the incorrect umap
I had to still do a bunch of installs and uninstalls of umap-learn
using conda
and pip
. Finally I made sure that site-packages
was clean and did a few more installs. Finally got it to work. So there was lots of frustration, but eventually got it to work.
from umap.
I have tried this, unfortunately, had no luck regarding the name confusion on pip. I am going to look at this again, I will let you know if there is any progress.
from umap.
Thanks. I'm sorry I can't be more help but I currently can't reproduce the problem (or even have any idea what might be causing it). Please keep me updated. I'm sure it is frustrating and I appreciate your patience and willingness to try and work through it.
from umap.
I still get this error and have tried the umap-learn trick using conda install :( I am using Mac OS X (Sierra)
from umap.
from umap.
I have the same problem , but at first my code worked without any problem but after some pip install of different library files it happens ,
umapdim=umap.UMAP(n_neighbors=20)
x_train_umap=umapdim.fit_transform(x_train,y=y_train)
x_test_umap=umapdim.transform(x_test)
fig,[ax1,ax2]=plt.subplots(1,2,figsize=(10,5))
ax1.scatter(x_train_umap[:,0],x_train_umap[:,1],c=y_train)
ax2.scatter(x_test_umap[:,0],x_test_umap[:,1],c=y_test)
plt.show()
svm.fit(x_train_umap,y_train)
y_test_predict=svm.predict(x_test_umap)
print((1.*(y_test_predict==y_test)).sum()/y_test.shape[0])
I had tried the above solution but they're not worked on my issue ., I have umap-learn and umap is not installed on my system .
is there any way to see witch library cause this conflict ?
from umap.
from umap.
from umap.
from umap.
Yes sir ,I agree with you in this case , I'm a newcomer on python , but from my former experiences on other programming software (specially on Siemens software's ) it's some times the only way.
from umap.
Not sure if this situation helps anyone (or is expected), but I ran into this situation when I tried to run transform() on new data, from a joblib pickle of a previous umap run, where that pickle was created from a previous release of umap.
I'm able to run transform() again after recreating the joblib pickle with the new version.
from umap.
Maybe we can look into by the joblib pickle works with scikit-learn models, but fails here...
from umap.
I also had the same issue (
import umap; umap.UMAP
returnsAttributeError: module 'umap' has no attribute 'UMAP'
) (MacOS, High Sierra, installed via pip).As a workaround
import umap.umap_ as umap
seems to work instead ofimport umap
this has worked for me
from umap.
The proper way to install UMAP is documented in the README.md.
Many people assume the package is called umap
while instead it is called umap-learn
.
Thank you for clarifying @benrhodeland.
In general: Read the README.
from umap.
Related Issues (20)
- Implementation of sciki-learn's get_feature_names_out() API is not correct
- Is 'n_training_epochs' working for parameteric UMAP?
- visualize video data
- How to combine UMAP models in new data?
- Edit instructions to make them compatible with zsh
- Empty API page on UMAP API Guide? HOT 1
- PCA diagnostic error HOT 2
- Speed inquries HOT 2
- UMAP crashes when torch also imported before first run HOT 2
- Unable to pickle trained UMAP instance
- Reducing Model Size for UMAP on Large Datasets HOT 2
- umap.UMAP accepts strings as n_neighbors and min_dist, causing later failures
- Optimal dimensions
- RunUMAP Failing HOT 1
- Semi-deterministic output even though randon_state is set
- TypeError: Dispatcher._rebuild() got an unexpected keyword argument 'impl_kind' HOT 1
- illegal hardware instruction python HOT 2
- Transform new input with composite model HOT 1
- Inquiry on Utilizing UMAP for Text Similarity and Clustering HOT 4
- No clear documentation of default parameter values HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from umap.