Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [cosine-distance]

The tag has no usage guidance.

1
vote
1answer
9 views

When I would use a specific similarity coefficient over another?

Like using Jaccards over Dice. I want real examples, of when I would prefer to use Jaccards, Dice, Cosine or any other similarity coefficient.
0
votes
0answers
16 views

consine similarity results are high

I have vectors of length 160, and I'm trying to measure the cosine similarity between they. Each value in the vector represents a feature (frequency of words in lexicons), so most (not all; to give ...
1
vote
0answers
117 views

cosine similarity between items (purchase data) and normalisation

I'm using IndexedRowMatrix which represents the products's user purchase behaviours and in order to build product recommendations, I use cosine similarity to calculate similarities between products. ...
1
vote
0answers
14 views

Best way to find dissimilarity in a 6x2 DataFrame?

I'm new to data science and am currently learning different techniques that I can do with Python. Currently, I'm trying it out with Spotify's API for my own playlists. The goal is to find the most ...
1
vote
0answers
19 views

Can I sum up feature vectors of a user‘s collection?

I want to find items that are similar to items users already have in their collection. Every item has attributes, so I created feature vectors where every element of the vector represents an attribute ...
2
votes
3answers
128 views

clustering 2-dimensional euclidean vectors - appropriate dissimilarity measure

I've got a set of approx. 50 000 2-dimensional euclidean vectors which are connected with 20 groups, i.e. each group has approx. 2500 2-dimensional euclidean vectors. My data includes endpoints ...
0
votes
0answers
951 views

How to do cosine similarity between two dataFrame efficiently

I have one DataFrame (d1) with (index, features) and a second one (d2) with the same columns....
2
votes
0answers
553 views

Clustering with cosine similarity with specific threshold (in Python)

Given : 1, either given the origin data matrix X , such as X = [[1,1,1,1],[1,1,-1,-1],[1,1,1,-1]] or given the cosine similarity matrix of the original data X , ...
1
vote
1answer
582 views

How to find similar time series?

I've got a collection of yearly data (one value per year per category), and I'd like to find series that are most similar to one another. Example data is here. I don't know much about data science, ...
5
votes
1answer
3k views

cosine_similarity returns matrix instead of single value

I am using below code to compute cosine similarity between the 2 vectors. It returns a matrix instead of a single value 0.8660254. [[ 1. 0.8660254] [...
5
votes
2answers
3k views

Can I use cosine similarity as a distance metric in a KNN algorithm

Most discussions of KNN mention Euclidean,Manhattan and Hamming distances, but they dont mention cosine similarity metric. Is there a reason for this?
2
votes
2answers
372 views

Confusion with cosine similarity

In information retrieval when we calculate the cosine similarity between the query features vector and the document features vector we penalize the unseen words in the query. Example if we have two ...
1
vote
1answer
2k views

Cosine similarity between query and document confusion

I am going through the Manning book for Information retrieval. Currently I am at the part about cosine similarity. One thing is not clear for me. Let's say that I have the tf idf vectors for the ...
0
votes
1answer
2k views

Create similarity matrix

I have a training set and a testing set of vectors. All the vectors are labeled. For each labeled vector in the testing set, there are 3 vectors in the training set with the same label. I'm using ...
1
vote
1answer
498 views

Computing Item-to-Item Similarity Using Cosine

I have a "User x Item" matrix as below: user item1 item2 item3 u1 2 0 3 u2 1 2 0 u3 4 3 1 u4 0 2 2 I want to computer the ...
1
vote
2answers
577 views

What techniques should I use to compare the similarity between a bunch of texts?

If I have a list of job postings stored as raw texts and I want to compare the similarity of all the job postings to a given resume, what techniques or algorithms should I use? I'm thinking of ...
4
votes
1answer
113 views

How should I evaluate writing quality to compare two articles(which article is better suited/written for a topic ) according to their content?

I am trying to come up with a platform which can Synthesize Quality Content among many articles found about some particular "topic" on the internet, the algorithm should be able to say recommend top ...
2
votes
0answers
280 views

Recommendation matrix as a product of User Similarity and Ratings

For both item-item and user-user collaborative filtering the recommendation matrix $Γ_{m x n}$, which is an (m x n) matrix, can be defined as: $$Γ(i,j)=r_{ij}$$ For user-user collaborative ...
13
votes
3answers
3k views

Alternatives to TF-IDF and Cosine Similarity when comparing documents of differing formats

I've been working on a small, personal project which takes a user's job skills and suggests the most ideal career for them based on those skills. I use a database of job listings to achieve this. At ...
2
votes
1answer
700 views

Is it possible to use Jaccard similarity instead of Cosine similarity in gensim document similarity?

I am using gensim library to compute similarity between documents but it only uses cosine similarity. I was wondering if there was a way to use jaccard similarity or any other similarity measure for ...
8
votes
1answer
10k views

Calculate cosine similarity in Apache Spark

I have a DataFrame with IDF of certain words computed. For example ...
9
votes
2answers
208 views

What should be the value of non-rated field when finding cosine similarity

I am working on a very basic book recommender system. I want to know what to do with the fields which aren't rated by the user when finding cosine similarity, should we ignore them and calculate only ...
2
votes
2answers
1k views

Word analysis in Python

I have a list of documents which look like this: ["Display is flickering"] ["Battery charger is broken"] ["Hard disk is making noises"] These text documents are ...
1
vote
0answers
494 views

Compute angle of vector in word2vec models

If I understand correctly, the most_similar function computes the cosine similarity of the vector with all other vectors and finds the closest one. The vectors ...
2
votes
3answers
3k views

How to find similarity/distance matrix with mixed Continuous and Categorical data?

Say I have a dataset like this: Hotel HasPool AvgPrice 1 1 $123 2 0 $234 3 1 $200 Currently I have broken down the ...
1
vote
2answers
116 views

Is Vector in Cosine Similarity the same as vector in Physics?

I'm new to Data Science. I'm trying to understand cosine similarity and it seems like the equation is about finding the distance between two vectors. From what I've Googled, a vector needs to have ...
1
vote
0answers
227 views

tf-idf clustering

I have over a million text documents that I would like to cluster. I used tf-idf modeling and term vector cosine for identifying similar documents in the corpus, which appeared to work well. Some ...
5
votes
1answer
5k views

Cosine Distance > 1 in scipy

I am working on a recommendation engine, and I have chosen to use SciPy's cosine distance as a way of comparing items. I have two vectors: ...