Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KNN Performance Comparison: C++ vs. Python

This repository contains implementations of the K-Nearest Neighbors (KNN) algorithm in both C++ and Python, along with a comparison of their runtime performance.

Introduction

K-Nearest Neighbors is a simple yet powerful classification algorithm widely used in machine learning and pattern recognition. In this repository, we provide implementations of KNN in both C++ and Python to explore the differences in runtime performance between the two languages.

Files

  • main.cpp: C++ implementation of the KNN algorithm.
  • main.py: Python implementation of the KNN algorithm.
  • data.csv: Sample datasets for testing the implementations.

Usage

  1. C++ Implementation: Compile main.cpp using your preferred C++ compiler.

    g++ -o main main.cpp

    Run the compiled executable:

    ./main
  2. Python Implementation: Run main.py using Python.

    python main.py

Performance Comparison

We measure the runtime performance of both implementations using various datasets and report the results in the performance_comparison.md file.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvement, feel free to open an issue or create a pull request.

About

This repository contains implementations of the K-Nearest Neighbors (KNN) algorithm in both C++ and Python, along with a comparison of their runtime performance.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages