Warning for axis_metric
See original GitHub issueLet’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.
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:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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.