Code Monkey home page Code Monkey logo

knn_visualizer's Introduction

Logo

kNN Visualizer

This project creates an image of various points, with each pixel colored according to that pixel's distance to the nearest couple of points and their respective colors. The user can specify the number of total points as well as the number of nearst points (or nearest neighbours) to be taken into account when creating the color of the pixel.

Installation

This program will not function without the Zelle graphics package, which itself requires tKinter.

For Windows:

  git clone https://github.com/Haquilus/kNN_Visualizer.git kNN_Visualizer
  cd kNN_Visualizer
  pip install graphics.py 
  pip install tk

For Ubuntu and Mac:

  git clone https://github.com/Haquilus/kNN_Visualizer.git kNN_Visualizer
  cd kNN_Visualizer
  pip install graphics.py
  sudo apt-get install python-tk

For Arch:

  git clone https://github.com/Haquilus/kNN_Visualizer.git kNN_Visualizer
  cd kNN_Visualizer
  pip install graphics.py
  sudo pacman -S tk

Running the Program

For all operasting systems:

  python main.py

Make sure you are inside the project dirctory, i.e. the kNN_Visualizer folder.

Optimizations

I apologise in advance for the render time. I tried forcing it to run on the gpu, but the graphics.py module does not work well with jit. Creating my own graphics environment is, at the time of making, both out of scope for the project and my skill level in python. I invite you to try and make the program run a little faster yourself.

Documentation

How to import your own points:

Install the prerequisites to run the code. In objects.py, you can create a new array of points and their colors, then import it to main and set it equal to pointsArray. Finally, run the program.

The exe file is currently out of date and should not be used.

Thanks for checking out my program!

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.