gk-knn

1.0.3 • Public • Published

gk-knn

Logo

npm npm

About

gk-knn is a library of k-nearest neighbors written in JavaScript.

Table of Contents

Examples

Node

getType

Execute getType with file name, test instance, k and fields to exclude as arguments.

node examples/getType.js 'iris.csv' '{"sepal_length":1,"sepal_width":2,"petal_length":3,"petal_width":4}' 7 ['type']

or with default parameters

node examples/getType.js 

getAccuracy

Execute getAccuracy with file name and fields to exclude as arguments.

node examples/getAccuracy.js 'iris.csv' ['type','sepal_length', 'sepal_width']
node examples/getAccuracy.js 'iris.csv' ['type']

or with default parameters

node examples/getAccuracy.js 

Browser

TODO

Usage

Node usage

If you have node, you can install gk-knn.js with npm:

npm install gk-knn

Or if you prefer yarn:

yarn add gk-knn

At present, the published version of gk-knn 1.0.3

Browser usage

TODO Download the latest gk-knn.js for browser.

Data format

Currently only .csv files are supported.

csv

The first line should hold label names.

sepal_length,sepal_width,petal_length,petal_width,type
5.1,3.5,1.4,0.2,Iris-setosa
4.9,3.0,1.4,0.2,Iris-setosa
4.7,3.2,1.3,0.2,Iris-setosa
...

JSON

TODO

Readme

Keywords

Package Sidebar

Install

npm i gk-knn

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

54 kB

Total Files

24

Last publish

Collaborators

  • gkontopulos