Pseudo Nearest Neighbors Python Library
Project description
py4pnn
Pseudo Nearest Neighbors Python Library
Getting Started
This project is simply implementation of Pseudo Nearest Neighbors algorithm in python programming language.
Prerequisites
This Project Has No Prerequisites
Installing
The easiest way to install py4pnn is using pip
pip install py4pnn
Usage
There is only 1 public method of pnn class. It is predict method, it takes 5 argument namely x_train, t_train, x_test, k, and distance calculation method. We provide 6 distance namely euclidean, squared_euclidean, manhattan, canberra, chebyshev, and bray_curtis.
from py4pnn.p_nearest_neighbors import pnn
classifier = pnn()
x_train = [[0.23,0.54],[0.45,1.23],[1.54,0.23],[0.93,0.535]]
t_train = [0,1,0,1]
x_test = [[0.34,0.65],[0.90,0.50]]
y = classifier.predict(x_train,t_train,x_test,1,'euclidean')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
py4pnn-0.0.3.tar.gz
(2.4 kB
view details)
Built Distribution
File details
Details for the file py4pnn-0.0.3.tar.gz
.
File metadata
- Download URL: py4pnn-0.0.3.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ce3d4ed2b51086d655f1c8de71b221f7c47bb28e8ba5142bace9686b7568936 |
|
MD5 | 1453f4d0062aec13e0f573457cc949a9 |
|
BLAKE2b-256 | c5d75ae741ea1e678ac80831a6dfb3e43623c1be609d7496b72118db232f8a2c |
File details
Details for the file py4pnn-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: py4pnn-0.0.3-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 197aef398b33f707cd3f7835b9cf0dba67c85fcf484ab6aadc1c2a0d7a6aa064 |
|
MD5 | e9071ab2c865b1841ec5fff6fab714b5 |
|
BLAKE2b-256 | b20fb5c5886dfdd3e562d6709dc15e650a62e5a38f2249fa11afef20dc90c407 |