question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple real valued labels

See original GitHub issue

Hi,

I’m working on a regression problem with multiple real valued targets. An exception is thrown by UMAP (attached below). I assume that it happens because I’m passing a multidimensional array as labels. Am I doing something wrong or is this mode not supported by the algorithm/implementation?

Thanks for everything!

Edit: After digging into the parameters for umap I found target_metric which I set to 'l2', but I still get an error when my target has shape (n_samples, n_targets)

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<timed exec> in <module>()

/usr/local/lib/python3.5/dist-packages/umap/umap_.py in fit_transform(self, X, y)
   1521             Embedding of the training data in low-dimensional space.
   1522         """
-> 1523         self.fit(X, y)
   1524         return self.embedding_
   1525 

/usr/local/lib/python3.5/dist-packages/umap/umap_.py in fit(self, X, y)
   1440                     far_dist = 1.0e12
   1441                 self.graph_ = categorical_simplicial_set_intersection(
-> 1442                     self.graph_, y, far_dist=far_dist
   1443                 )
   1444             else:

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
lmcinnescommented, Sep 28, 2018

I think, unfortunately, that transforming new points through this custom pipeline is going to be non-trivial. It can be done, but I will have to work out exactly what incantations one would need to do so.

On Fri, Sep 28, 2018 at 3:39 AM GCBallesteros notifications@github.com wrote:

That worked beautifully! Thanks!

One question remains. How can I test new unseen data points. I tried using fit1.transform(test_features) because it was the only obvious thing to do but that didn’t work. Any ideas?

Thanks again for the awesome code!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lmcinnes/umap/issues/145#issuecomment-425350160, or mute the thread https://github.com/notifications/unsubscribe-auth/ALaKBXRZPG0h1cCbEeTKXD75ohqBqworks5ufdIxgaJpZM4W4Zo7 .

0reactions
ZZKnightcommented, Sep 7, 2021

Thanks for you suggestions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiple-Instance Learning of Real-Valued Data
Most prior work on multiple-instance learning has been for concept learning, yet for drug activity prediction, the label is a real-valued affinity.
Read more >
Deep dive into multi-label classification..! (With detailed Case ...
In multi-label classification, a misclassification is no longer a hard wrong or right. A prediction containing a subset of the actual classes ...
Read more >
Multi-label classification - Wikipedia
Formally, multi-label classification is the problem of finding a model that maps inputs x to binary vectors y; that is, it assigns a...
Read more >
Multi-Label Classification with Deep Learning
The dataset will have three class label outputs for each sample and each class will have one or two values (0 or 1,...
Read more >
Classification of real values - Cross Validated - Stack Exchange
I want to label 15 classes to 6 like value of attribute greater than ... away information, and many people actually recommend against...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found