Skip to content

felixduvallet/kmeans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kmeans

C++ implementation of K-Means. Build Status

Usage:

kmeans <file>

where file is a list of points (space-separated), one point per line. example:

 1.23 4.56 7.89
 3.21 6.54 9.87

Build instructions:

mkdir build
cd build
cmake ..
make
make test

Run on some sample data

There are some traces of sample data in the src/sample_data folder. data_N_D.txt contains N D-dimensional points.

For example, you can run kmeans on 200 2-dimensional points.

cd build
./kmeans data_200_2.txt 2

This produces a file means.txt that looks something like:

3.96207 -1.92886
-2.01688 -2.98501