Git Product home page Git Product logo

parallel_knn's Introduction

This is a parallel implementation of the Knn algorithm. I'm using CPU threading to use multiple threads to divide the Knn task.
To run the file just run the ./main. To change the number of threads in the code change the n_threads to desired amount.

Comparing the runtime of the serial and parallel versions considering the datasets with different
sizes. The speedup using 2, 4, and 8 threads are:

For reference the time taken by the serial code on my system is:
Small dataset: 29 ms
Medium dataset: 10354 ms

Following is the average of 5 runs per dataset with the specified number of threads:
Small dataset:
2 threads - 20 ms
4 threads - 17 ms
8 threads - 13 ms

Medium dataset:
2 threads - 5047 ms
4 threads - 2635 ms
8 threads - 2096 ms

These evaluations are done on an i7 6700HQ 2.6GHz Quad-core Processor

parallel_knn's People

Contributors

amankochhar avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.