Giter Site home page Giter Site logo

k-means-and-knn-implementation's Introduction

K-means-and-KNN-implementation

(After coverting the .ipynb files to .py)

Run the code with the following command in the terminal,

python AI_Kmeans.py python AI_KNN.py

FOR K-MEANS:

When run the code will prompt to enter the loction of all centroids (space between two different centroids) eg, 0,0 20,20 are two centroids (0, 0) and (20, 20)

Next the code will prompt to enter the input file name, here input the name of the file with extention.

Next, the code will prompt will ask to input distance calculation metric (manh/e2). e2 is the default.

After executing the code will print the all points belonging to a centroid gang and updated location of centroids.

It will prompt for an input. Here give the name of the input txt file with extension.

FOR KNN:

When run the code will prompt to enter the train file name. Here enter the name of the train file with extention.

Next the code will prompt to enter the enter test file name. Here enter the name of the test file with extention.

Next, the code will prompt will ask to enter distance calculation metric (manh/e2). e2 is the default.

Next, the code will prompt will ask to enter k value. 3 is the default k value

Next, the code will prompt will ask to enter the weighing method ((1/d)/unit). 1/d is the default.

After executing the code will print the labels assigned to all points as well as precision and recall for each label.

THANK YOU!!

k-means-and-knn-implementation's People

Contributors

pradygn avatar

Watchers

 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.