minivnn


Nameminivnn JSON
Version 0.1.1 PyPI version JSON
download
home_page
SummaryExact nearest neighbor search library for those times when "approximate" just won't cut it (or is simply overkill)
upload_time2023-04-28 16:54:54
maintainer
docs_urlNone
authoraismlv
requires_python>=3.9,<4.0
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # minivnn

![Tests](https://github.com/aismlv/minivnn/actions/workflows/test_and_lint.yml/badge.svg)
[![codecov](https://codecov.io/gh/aismlv/minivnn/branch/main/graph/badge.svg?token=5J503UR8O7)](https://codecov.io/gh/aismlv/minivnn)
[![PyPI version](https://badge.fury.io/py/minivnn.svg)](https://pypi.org/project/minivnn/)
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

`minivnn` (pronounced "minivan" 🚐) is an exact nearest neighbor search Python library for those times when "approximate" just won't cut it (or is simply overkill).

## Installation

Install `minivnn` using `pip`:

```bash
pip install minivnn
```

## Usage
Here's an example of how to use minivnn:

```python
from minivnn import Index
import numpy as np

# Create an index with 128-dimensional embeddings and cosine similarity metric
index = Index(dim=128, metric="cosine")

# Add embeddings to the index
embedding1 = np.random.rand(128)
embedding2 = np.random.rand(128)
embedding3 = np.random.rand(128)

index.add([1, 2, 3], [embedding1, embedding2, embedding3])

# Delete embeddings from the index
index.delete_items([3])

# Query the index for the nearest neighbor of a given embedding
query_embedding = np.random.rand(128)
result = index.query(query_embedding, k=1)

print(result)  # Returns [(index, similarity)] of the nearest neighbor
```

Supported metrics are cosine similarity and dot product.


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "minivnn",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "aismlv",
    "author_email": "adilzhan.ismailov@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/bd/3e/260ea79474a6d488950e321b2664a2d6263f4c4a8ebb55a0a73eda143be4/minivnn-0.1.1.tar.gz",
    "platform": null,
    "description": "# minivnn\n\n![Tests](https://github.com/aismlv/minivnn/actions/workflows/test_and_lint.yml/badge.svg)\n[![codecov](https://codecov.io/gh/aismlv/minivnn/branch/main/graph/badge.svg?token=5J503UR8O7)](https://codecov.io/gh/aismlv/minivnn)\n[![PyPI version](https://badge.fury.io/py/minivnn.svg)](https://pypi.org/project/minivnn/)\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n`minivnn` (pronounced \"minivan\" \ud83d\ude90) is an exact nearest neighbor search Python library for those times when \"approximate\" just won't cut it (or is simply overkill).\n\n## Installation\n\nInstall `minivnn` using `pip`:\n\n```bash\npip install minivnn\n```\n\n## Usage\nHere's an example of how to use minivnn:\n\n```python\nfrom minivnn import Index\nimport numpy as np\n\n# Create an index with 128-dimensional embeddings and cosine similarity metric\nindex = Index(dim=128, metric=\"cosine\")\n\n# Add embeddings to the index\nembedding1 = np.random.rand(128)\nembedding2 = np.random.rand(128)\nembedding3 = np.random.rand(128)\n\nindex.add([1, 2, 3], [embedding1, embedding2, embedding3])\n\n# Delete embeddings from the index\nindex.delete_items([3])\n\n# Query the index for the nearest neighbor of a given embedding\nquery_embedding = np.random.rand(128)\nresult = index.query(query_embedding, k=1)\n\nprint(result)  # Returns [(index, similarity)] of the nearest neighbor\n```\n\nSupported metrics are cosine similarity and dot product.\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Exact nearest neighbor search library for those times when \"approximate\" just won't cut it (or is simply overkill)",
    "version": "0.1.1",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5ad9c49d728ea432ca1e920e59a6d4450dc2e4220f9cd335743af93373882094",
                "md5": "420c01d532329e97f5cea8c1a2c627bc",
                "sha256": "4f8b1577aef70488f4c4e172bfc3a65a1ae345bb7b52e669827583f382ce6419"
            },
            "downloads": -1,
            "filename": "minivnn-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "420c01d532329e97f5cea8c1a2c627bc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 2950,
            "upload_time": "2023-04-28T16:54:53",
            "upload_time_iso_8601": "2023-04-28T16:54:53.114469Z",
            "url": "https://files.pythonhosted.org/packages/5a/d9/c49d728ea432ca1e920e59a6d4450dc2e4220f9cd335743af93373882094/minivnn-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bd3e260ea79474a6d488950e321b2664a2d6263f4c4a8ebb55a0a73eda143be4",
                "md5": "3a16c0539cbd1000429cd6e4e1106ca5",
                "sha256": "ec5c8ea7e1031e96730ed291554a0743ecd9709b023c7ccd15fcf359fc0d986a"
            },
            "downloads": -1,
            "filename": "minivnn-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "3a16c0539cbd1000429cd6e4e1106ca5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 2534,
            "upload_time": "2023-04-28T16:54:54",
            "upload_time_iso_8601": "2023-04-28T16:54:54.277545Z",
            "url": "https://files.pythonhosted.org/packages/bd/3e/260ea79474a6d488950e321b2664a2d6263f4c4a8ebb55a0a73eda143be4/minivnn-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-28 16:54:54",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "minivnn"
}
        
Elapsed time: 1.37711s