Giter Club home page Giter Club logo

kmeans's Introduction

K-means Spotify

Use K-means clustering to group Spotify data based on metrics found in genres_v2.csv.

Description

Serial

The serial implementation implemented the K-means clustering algorithm as simply as possible with, a focus on isolating the functional parts of the program to aid parallelization later on.

Shared CPU

The shared CPU implementation made use of OpenMP to parallelize portions of logic that were frequently running. Typically, this entailed the use of the parallel for directive to divide the serial work among processors.

Shared GPU

The shared GPU implementation condensed much of the code down to its bare essentials. Using CUDA allowed the creation of kernels that could be launched to seperate the work of what would ususally be a serial loop. Although the output does not identically match the serial implementation, the visualization is inidstiguishable from the above implementations.

Compilation

Makefiles are included in each subdirectory.

Compile with make

Execution Script

The execution, validation and visualization steps can all be run with.

bash run-all.sh

Execution

Each file has been already compiled within its subdirectory, and can be run as follows:

./serial ../indata.csv > outdata

The output is an in-order list of each song's cluster.

Visualization

Visulization can be run using matplotlib as follows:

python3 visualize.py serial shared-cpu shared-gpu

Validation

Validation was performed with GNU's diff program as follows:

diff -q serial/outdata shared-cpu/outdata

Input

The input has been altered to only include the three visualized columns. An input file with more columns can be added by replacing the COLS definition in kmeans.h

kmeans's People

Contributors

carterparks avatar

Watchers

 avatar  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.