Skip to content

Cluster K Means implementation made with Asp.net Core web API Server & Plotly library in Python

License

Notifications You must be signed in to change notification settings

SirCypkowskyy/Cluster-K-Means-NAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cluster K-Means Algorithm

PJAIT - Artificial Intelligence Tools (NAI)

Cyprian Gburek

s24759, 17c


Table of Contents

General info

The project is a part of the Artificial Intelligence Tools (NAI) course at PJAIT. The goal of the project was to implement the Cluster K-Means algorithm and test it on a dataset of our choice. The dataset I chose was a small Iris dataset, which contains 150 samples of 3 different species of Iris flowers. The dataset contains 4 features: sepal length, sepal width, petal length and petal width. The goal of the algorithm is to cluster the samples into 3 clusters, each representing a different species of Iris flower.

Technologies


My programming skills


  • Backend:
    • C#
    • .NET Core 7.0 (Web API)
  • Frontend:
    • Python 3.9
    • Pandas
    • Plotly

Setup

To run this project, you need to have .NET Core 7.0 installed on your machine. You can download it from here.

After installing .NET Core, you can clone the repository and run the project using the following commands:

# Clone the repository
git clone
# Navigate to the project directory from project root
cd Cluster-K-Means-NAI-Server
# Run the project
dotnet run

After running the project, you can access the API at specified port (default: 7097).

Now you can run the Python script to test the algorithm on the Iris dataset. To do so, you need to have Python 3.9 installed on your machine. You can download it from here.

After installing Python, you can run the script using the following commands:

# Navigate to the project directory from project root
cd ClientApp
# Install the required dependencies from requirements.txt
pip install -r requirements.txt
# Run the script with specified parameters
python main.py [k number of clusters] [path to dataset]

If needed, edit the main.py file to change various parameters of the algorithm, such as number of clusters, number of iterations, 3D Scatter or 2D, etc.

Results

The algorithm was able to cluster the samples into 3 clusters, each representing a different species of Iris flower. The results are presented with following examples:

Cluster K-Means Algorithm Results 1 Cluster K-Means Algorithm Results 2 Cluster K-Means Algorithm Results 3

Credits

About

Cluster K Means implementation made with Asp.net Core web API Server & Plotly library in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published