# knnn
K-Nearest Neighbors of Neighbors
```bash
pip install knnn
```
# Description
This package provides a simple implementation of the K-Nearest Neighbors of Neighbors algorithm. The algorithm is a simple extension of the K-Nearest Neighbors algorithm, which is used for anomaly detection. The algorithm is based on the idea that the neighbors of the neighbors of a point gives more information than its neighbors. The algorithm can be used to improve the accuracy of the KNN algorithm.
# Usage
``` python
from knnn import KNNN
import numpy as np
# Random data
x_normal = np.random.rand(100, 2)
x_test = np.random.rand(20, 2) + 1
# Create a KNNN object
knnn = KNNN(num_neighbors=3, num_neighbors_of_neighbors=25)
# Fit the model
knnn.fit(x_normal)
# Predict the labels of the test data
y_pred = knnn.predict(x_test)
```
# Installation
The simplest way to install the package is to run:
```bash
pip install knnn
```
If you want to install the latest version from the master branch:
(-e option will allow you to change the code without reinstalling the package)
```bash
git clone https:\\github.com\knnn
cd knnn
python3 -m pip install -e .
```
If you want to build the package from source, run:
```bash
python3 -m build
```
and to install the built package, run:
```bash
python3 -m pip install --force-reinstall dist/*.whl
```
To run the tests, run:
```bash
pytest
```
Raw data
{
"_id": null,
"home_page": "https://github.com/onr/knnn",
"name": "knnn",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "knnn, knn, embedding",
"author": "Ori Nizan",
"author_email": "restin3@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/52/d4/717d22dc1f09b900d8e0bb6a289dd5ccc5405d8b4817c0d684b3c273478b/knnn-0.0.8.tar.gz",
"platform": null,
"description": "# knnn\nK-Nearest Neighbors of Neighbors\n```bash \npip install knnn\n```\n\n# Description\nThis package provides a simple implementation of the K-Nearest Neighbors of Neighbors algorithm. The algorithm is a simple extension of the K-Nearest Neighbors algorithm, which is used for anomaly detection. The algorithm is based on the idea that the neighbors of the neighbors of a point gives more information than its neighbors. The algorithm can be used to improve the accuracy of the KNN algorithm.\n\n\n# Usage\n``` python\nfrom knnn import KNNN\nimport numpy as np\n\n# Random data\nx_normal = np.random.rand(100, 2)\nx_test = np.random.rand(20, 2) + 1\n\n# Create a KNNN object\nknnn = KNNN(num_neighbors=3, num_neighbors_of_neighbors=25)\n# Fit the model\nknnn.fit(x_normal)\n# Predict the labels of the test data\ny_pred = knnn.predict(x_test)\n\n```\n\n\n# Installation\nThe simplest way to install the package is to run:\n```bash \npip install knnn\n```\nIf you want to install the latest version from the master branch: \n\n(-e option will allow you to change the code without reinstalling the package)\n```bash\ngit clone https:\\\\github.com\\knnn\ncd knnn\npython3 -m pip install -e . \n```\nIf you want to build the package from source, run:\n```bash\npython3 -m build\n``` \nand to install the built package, run:\n```bash\npython3 -m pip install --force-reinstall dist/*.whl\n```\nTo run the tests, run:\n```bash\npytest\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "An implementation of KNNN algorithm",
"version": "0.0.8",
"project_urls": {
"Bug Tracker": "https://github.com/onr/knnn/issues",
"Homepage": "https://github.com/onr/knnn"
},
"split_keywords": [
"knnn",
" knn",
" embedding"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8a8fd8cd76df148c68778d31897931d7b5d4e8609c27b0585c148bf0407db456",
"md5": "f1007d197d3e9a2445656445a058b8c0",
"sha256": "ebaeb68d86132f1760e4ce4b945e114ce44da92cf7114c9175d06a333a3dc41e"
},
"downloads": -1,
"filename": "knnn-0.0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f1007d197d3e9a2445656445a058b8c0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 20812,
"upload_time": "2024-10-16T09:09:38",
"upload_time_iso_8601": "2024-10-16T09:09:38.582210Z",
"url": "https://files.pythonhosted.org/packages/8a/8f/d8cd76df148c68778d31897931d7b5d4e8609c27b0585c148bf0407db456/knnn-0.0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "52d4717d22dc1f09b900d8e0bb6a289dd5ccc5405d8b4817c0d684b3c273478b",
"md5": "9591472c91ed12c38836eb8e65b6bdbe",
"sha256": "fb1d5659edb0705aed3fbbf4af9d518fba57e901d00190a8218400fb3db2f7de"
},
"downloads": -1,
"filename": "knnn-0.0.8.tar.gz",
"has_sig": false,
"md5_digest": "9591472c91ed12c38836eb8e65b6bdbe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 18559,
"upload_time": "2024-10-16T09:09:40",
"upload_time_iso_8601": "2024-10-16T09:09:40.247540Z",
"url": "https://files.pythonhosted.org/packages/52/d4/717d22dc1f09b900d8e0bb6a289dd5ccc5405d8b4817c0d684b3c273478b/knnn-0.0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-16 09:09:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "onr",
"github_project": "knnn",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "knnn"
}