Skip to content

Latest commit

 

History

History

python-knn

CHUV DockerHub ImageVersion ImageLayers

Python k-nearest neighbors

Implementation of k-nearest neighbors algorithm in Python.

Number of neighbors is parametrized using env MODEL_PARAM_k.

Usage

It has two modes

  1. compute --mode intermediate
  2. compute --mode aggregate --job-ids 1 2 3

Intermediate mode calculates knn from a single node, while aggregate mode is used after intermediate to combine knn from multiple jobs. Intermediate mode can be also used to calculate knn from single node.

Build (for contributors)

Run: ./build.sh

Integration Test (for contributors)

Run: captain test

Publish (for contributors)

Run: ./publish.sh

Unit tests (for contributors)

WARNING: unit tests can fail nondeterministically on AttributeError: can't set attribute because of some error in Titus port to Python 3

Run unit tests

find . -name \*.pyc -delete
(cd tests; docker-compose run test_suite -x --ff --capture=no)