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.

cosine metric throws an error

See original GitHub issue

I get the following error when trying to run compare.String

AttributeError: 'numpy.ndarray' object has no attribute 'where'

when running this line:

compare_cl.string('AddressLine1', 'AddressLine1', method='cosine', threshold=0.9, label='AddressLine1')

It worked with ‘damerau_levenshtein’.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Rosina9700commented, Mar 17, 2020

@J535D165 I have the changes on a branch. Can you add me as a contributor and I’ll push the branch and cut a PR Ignore this, I’m new to open source contributions but realized I could cut the PR from my fork. That PR is open now.

0reactions
geobettscommented, Mar 9, 2021

I also get this issue. There is no error if you set threshold to None.

So this should work:

compare_cl.string('AddressLine1', 'AddressLine1', method='cosine', threshold=None, label='AddressLine1')
Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't seem to get cosine metric working. #69 - GitHub
Here's > what I've tried so far: > > - > > Straight up using metric='cosine' doesn't work at all because it's not...
Read more >
DBSCAN error with cosine metric in python - Stack Overflow
I was trying to use DBSCAN algorithm from scikit-learn library with cosine metric but was stuck with the error. The line of code...
Read more >
Cosine similarity error: index 1 is out of bounds for axis 1 with ...
I'm currently trying to extract cosine similarity values to compare two different texts, using TF-IDF values. This is the code I'm using:.
Read more >
Duplicate detection/classification using TF/IDF and cosine ...
I am working on text classification using TF/IDF and cosine similarity metrics. In computing the similarity between two records (objects) in ...
Read more >
cosine similarity
When i run the below code of lines in R version 4.0.3 throws the below error message: Error in (function (classes, fdef, mtable)...
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