GithubHelp home page GithubHelp logo

xixihaha369300 / meanshift_cpp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mattnedrich/meanshift_cpp

0.0 0.0 0.0 146 KB

Mean shift clustering Implementation in C++

License: MIT License

Makefile 1.04% C++ 97.36% CMake 1.59%

meanshift_cpp's Introduction

MeanShift++

MeanShift_cpp is an implementation of MeanShift clustering in C++

Current Version

The current version is functional, but very limited

Usage

The current programming model includes a class MeanShift. The MeanShift constructor takes a function pointer to a kernel function to be used in the clustering process. If NULL, it will use a Gaussian kernel.

Points are assumed to be vector<double>. Point collections are assumed to be vector<vector<double> >. This may change in the future.

To cluster a set of points, create a MeanShift object and call the cluster method with a collection of points and a kernel bandwidth. The shifted point will be returned as a vector<vector<double> >. Note that the points are not currently grouped into cluters, but rather shifted to their converged locations.

Example

vector<vector<double> > points = load_points("test_simple.csv");
MeanShift *ms = new MeanShift(NULL);
double kernel_bandwidth = 2;
vector<vector<double> > shifted_points = ms->cluster(points, 2);

Visualization for Linux

Install gnuplot and gnuplot-qt

sudo apt-get install gnuplot gnuplot-qt

Make and run the cpp_test

make
./MeanShift

The program will generate a csv file named "result.csv".

Plot it

gnuplot
plot 'test.csv' with points, 'result.csv' with points

License

MIT License

meanshift_cpp's People

Contributors

mattnedrich avatar andreyvps avatar facontidavide avatar kenfox avatar willyzw 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.