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.

Warning for axis_metric

See original GitHub issue

Let’s set up a small embeddingset.

from whatlies.language import SpacyLanguage
from whatlies.transformers import Pca

words = ["prince", "princess", "nurse", "doctor", "banker", "man", "woman",
         "cousin", "neice", "king", "queen", "dude", "guy", "gal", "fire",
         "dog", "cat", "mouse", "red", "bluee", "green", "yellow", "water",
         "person", "family", "brother", "sister"]

lang = SpacyLanguage("en_core_web_md")
emb = lang[words]

Let’s now make some charts.

emb.transform(Pca(2)).plot(kind='scatter', annot=True)
emb.transform(Pca(2)).plot(kind='scatter', annot=True, axis_metric='cosine')
emb.transform(Pca(2)).plot(kind='scatter', annot=True, axis_metric='euclidean')

At the moment, they all seem to return this chart.

image

It took me a while to realise that the reason why this was not working as expected was because of the fact that I’m not using "king" as an x_axis/y_axis. Maybe we should introduce a warning here. Might be more user friendly.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
koaningcommented, Sep 9, 2020

It’s certainly in the docs, and this was certainly a moment of “lack of attention” on my part, but I can imagine that these small changes can help beginning users. I’ll add a small warning.

1reaction
mkazecommented, Sep 9, 2020

Maybe we should introduce a warning here. Might be more user friendly.

Well, I have mentioned this in the docstrings that custom metric is only effective when the axis is a string or an Embedding (hence it will be ignored when integer axis is provided, which is the default):

https://github.com/RasaHQ/whatlies/blob/6811b7a24b71f169c5b97a0f8a17572f07f96f94/whatlies/embeddingset.py#L949-L950

But we can also add a warning for it if you consider it to be useful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Axisymmetric Mesh: Warning about nodes below x-axis
WARNING : Invalid axisymmetric mesh with nodes lying below the x-axis. Checking element type consistency.
Read more >
What are the requirements for an axisymmetric analysis?
Axisymmetric indicates that the domain is axisymmetric about the x axis. ... WARNING: Invalid axisymmetric mesh: 6 nodes lie below the x-axis.
Read more >
Missing warning about incorrect axisymmetric BC setups #691
I am running an axisymmetric case recently, and got some issues when the first edge/face of related element was not aligned along the...
Read more >
Invalid axisymmetric mesh with nodes lying below the x-axis
I am facing with an issue in fluent where it shows an error saying: "Invalid axisymmetric mesh with nodes lying below the x-axis"....
Read more >
Axisymmetric Problem - an overview | ScienceDirect Topics
Axisymmetric problems occur in a large number of different branches of industry and take the form of circular cylinders, cones, domes, toroids, etc....
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