Comments (3)
The cosine variant is likely going to be removed from Lucene: apache/lucene#13281
from crate.
Today, when creating a FLOAT_VECTOR, it uses the default EUCLIDEAN_HNSW (L2) similarity.
During creation time, it should be possible to provide Cosine Similarity or Dot Product as similarity functions as available in lucene
"Feature I want is missing" is not a very good problem statement. Could you elaborate on the concrete use-case a bit more, to get a better idea about why cosine or dot product similarity would be beneficial there?
from crate.
While euclidean distance focuses on the absolute magnitude difference between vectors, cosine similarity focuses on the angular difference, and dot product considers both the magnitude and angular difference. The choice of metric depends on the specific use case and the properties of the vector embeddings. The developer should be able to differentiate between these different options to create an optimal implementation for their use case - which might require to use a different similarity function.
Euclidean Distance
- Measures the straight-line distance between two vectors in a multi-dimensional space.
- Calculated as the square root of the sum of the squared differences between the corresponding vector components.
- Sensitive to the magnitude of the vectors, so vectors with large values will have larger Euclidean distances even if they are otherwise similar.
- Useful when the vector embeddings contain information about counts or measures, like in recommendation systems.
Cosine Similarity
- Measures the cosine of the angle between two vectors.
- Calculated as the dot product of the vectors divided by the product of their magnitudes.
- Only considers the direction of the vectors, not their magnitude.
- Commonly used in natural language processing to measure the similarity between documents.
- Inverse relationship with cosine distance - as distance increases, similarity decreases.
Dot Product
- Measures the projection of one vector onto another.
- Calculated by summing the products of the corresponding vector components.
- Proportional to both the vectors' magnitudes and the cosine of the angle between them.
- Can be affected by the length of the vectors, so popular examples may skew the similarity metric.
from crate.
Related Issues (20)
- Add role session setting defaults HOT 1
- Add support to work with FDW in Postgres compatible tools (e.g. DBeaver) HOT 1
- Can't read object, timestamp, geopoint fields from remote CrateDB cluster using FDW HOT 1
- Allow FDW user mapping against roles HOT 3
- Allow the use of EXPLAIN ANALYZE on queries with scalar subselects
- Ensure own password is also hidden when querying `information_schema.user_mapping_options` HOT 2
- SQLParseException on query with subqueries with latest nightly HOT 4
- FDW - Cannot read JSONB directly from PostgreSQL Server HOT 2
- Expand `OBJECT`s during view creation to include subfields in metadata HOT 4
- ClassCastException on function with RETURNS OBJECT HOT 2
- Support `ALTER SERVER` to change connection url
- Support PUBLIC user mapping for FDW HOT 1
- Unexpected result when using `PG_GET_PARTKEYDEF` HOT 1
- Unexpected result when using `DEFAULT` during creating table HOT 1
- Regression on correlated subqueries HOT 2
- Meta - Foreign Tables with PostgreSQL JSON(B) Columns HOT 6
- Can't join foreign table with a local table in a multi-node cluster HOT 1
- INSERT INTO much slower than separate SELECT and INSERT HOT 4
- Ignored objects in foreign tables should be fetched as a whole
- Support sas_token for Azure Snapshot repository
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crate.