Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.
Calculate Cosine Similarity based on SVD
Muhammed_Fatih_
Member Posts: 93 Maven
in Help
Dear Community,
is it technically or rather mathematically possible to calculate the Cosine Similarity measure based on results derived by SVD Feature Extraction? Or does the distance metric only operate on measures like TF-IDF?
Thank you in advance for your help!
is it technically or rather mathematically possible to calculate the Cosine Similarity measure based on results derived by SVD Feature Extraction? Or does the distance metric only operate on measures like TF-IDF?
Thank you in advance for your help!
0
Best Answer
-
MartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,531 RM Data ScientistHallo @Muhammed_Fatih_ ,Doch wie sind die aus der Cosine Similarity resultierenden Informationen zu deuten, wenn diese ebenfalls negative Werte aufweisen?Je näher an 0, je ähnlicher. Ich glaube das ist aber auch was RM spezifisches. Alternativ kannst du wie gesagt den Cross-Distance operator nehmen. Der gibt dir dann auch positive CosinusDistances.Am Rande: Ich denke dass der Operator Extract Topics (LDA) für dich von großer Relevanz wäre.LG,Martin
- Sr. Director Data Solutions, Altair RapidMiner -
Dortmund, Germany5
Answers
Dortmund, Germany
Hi Community,
thank you for your answer! I have another question in connection to this one:
I've calculated Cosine Similarity based on SVD values and got also negative values as result. The classic literature writes that the range for cosine similarity should normally be between 0 and 1. In my case, SVD values are used as input so that the range or rather angle of Cosine Similarity cannot stay between the defined one.
Hence, negative values were derived. My question goes with regard to the interpretation potential of the cos sim measure. How to interprete negative Cos Sim values? Normally, the closer the cosine value to 1, the smaller the angle and the greater the match between vectors. Is it possible to assume a symmetry for negative values - e.g. to interptete a Cos Sim value of -0,9 as a greater match than 0,6?
Thank you in advance for your answer!
Best regards
Dortmund, Germany
I've calculated the Cosine Similarity by using the "Data to Similarity" operator.
Best regards!
Dortmund, Germany
sry - I didn't get your point. Does this mean that negative Cosine Similarity derived by SVD values as e.g. -1 or -0,8 reflect vector points that are completely contrary located and that positive values underline the similarity of objects?
Thank you for your clarification!
Best regards!
Dortmund, Germany
gerne in Deutsch Es geht mir bei meiner Analyse darum quantifizierte Texteinheiten, welche eine syntaktische Ähnlichkeit aufweisen, in gemeinsame Kategorien zu clustern. Hierfür wird in der Literatur die Cosine Similarity empfohlen. Die Besonderheit in meinem Anwendungsfall lag allerdings darin, dass ich im vorhergehenden Schritt eine Dimensionsreduktion mittels SVD durchgeführt wurde, um die Anzahl an Dimensionen in einer effizienten Art und Weise einzuschränken.
Insofern besteht aktuell die Frage, inwiefern die SVD-Input values, die in den Operator Cosine Similarity integriert wurden, zu deuten sind. Im Falle der von dir vorgeschlagenen Cosinus Distanz würde ein Minimierungsziel vorliegen und bei der Cosine Similarity ein Maximierungsziel. Doch wie sind die aus der Cosine Similarity resultierenden Informationen zu deuten, wenn diese ebenfalls negative Werte aufweisen?
Zur Sicherheit: Habe ich aus deinem vorhergehenden Kommentar richtig entnommen, dass der Cosine Similartiy nichts anderes als folgendes besagt: Cosine Similarity = (-1) * CosineDistance?
Thank you in advance for your answer and the clarification!
Best regards!
das bedeutet, dass die Winkel-Berechnung nach cos(x) im RM-Operator überhaupt nicht erfolgt, richtig?
Best regards!
Dortmund, Germany