Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uMAP code error in example exercise #943

Open
Dyn-Walker opened this issue Dec 12, 2022 · 2 comments
Open

uMAP code error in example exercise #943

Dyn-Walker opened this issue Dec 12, 2022 · 2 comments

Comments

@Dyn-Walker
Copy link

I copied and pasted the code for the examples so as to follow along, confirm the code worked and to use it as a base for my own data. The Penguin example works fine, however, when I move on to the "digits" example, I get the following errors. As I am a newbie to Python, I don't known how to go about resolving the error. Furthermore, as it is the code for the sample exercise, it may require correcting and/or a note in Frequently Asked Questions.

image

Thank you.

Regards,

Rick

@jlmelville
Copy link
Collaborator

I think you are referring to the docs at https://umap-learn.readthedocs.io/en/latest/basic_usage.html#digits-data.

This bit:

    UMAP(a=None, angular_rp_forest=False, b=None,
         force_approximation_algorithm=False, init='spectral', learning_rate=1.0,
         local_connectivity=1.0, low_memory=False, metric='euclidean',
         metric_kwds=None, min_dist=0.1, n_components=2, n_epochs=None,
         n_neighbors=15, negative_sample_rate=5, output_metric='euclidean',
         output_metric_kwds=None, random_state=42, repulsion_strength=1.0,
         set_op_mix_ratio=1.0, spread=1.0, target_metric='categorical',
         target_metric_kwds=None, target_n_neighbors=-1, target_weight=0.5,
         transform_queue_size=4.0, transform_seed=42, unique=False, verbose=False)

is supposed to represent the output you would get from the previous box's input, specifically the output from running reducer.fit(digits.data). Unfortunately, the current formatting of code doesn't make the difference between output and what the user is supposed to enter very clear. Also, the output has changed a little bit with more recent versions of UMAP. As I was the last person to touch this document, I will see what I can do to improve this. Thanks for pointing this out.

For the rest of that document, all but one of the green boxes indicate code you are intended to enter directly and should not give errors. The one exception is the box that consists entirely of (1797, 2). That is unnecessary and pointless to type in, but it won't break anything.

@Dyn-Walker
Copy link
Author

Dyn-Walker commented Dec 20, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants