mattnedrich / meanshift_cpp Goto Github PK
View Code? Open in Web Editor NEWMean shift clustering Implementation in C++
License: MIT License
Mean shift clustering Implementation in C++
License: MIT License
Hi,
performance wise, I noticed that the way you use std::vector to store the multidimensional points is very inefficient, mainly because std::vector will require a memory allocation.
Most of the time the dimension of the points is known at compilation time. This means that points are usually stored in an already known data structure or in a std:.array.
I would like to send a pull request that solve this problem and use templates to accept any type.
Would you accept this PR?
Regards
Davide
It is needed to set datafile separator otherwise gnuplot ignores X axe.
gnuplot
set datafile separator ","
plot ...
Hi,
shouldn't
MeanShift(double (*_kernel_func)(double,double)) { set_kernel(kernel_func); }
be
MeanShift(double (*_kernel_func)(double,double)) { set_kernel(_kernel_func); }
?
Cheers,
Phil
By reading your source code, I did not found how the clusters are gonna be counted.
How do we know many clusters are there?
Sorry if the question is not relevant.
Thanks for your work!
Is there any vision to support the input data for cols>2?
Hi,
thanks for the awesome implementation in c++ that is exactly what I need.
But I have one question regarding the Gaussian kernel. Why is the kernel equal to this?
double temp = exp(- (distance*distance) / (kernel_bandwidth));
which I have changed to following referring to the definition of Gaussian
double temp = exp(- 1.0/2.0 * (distance*distance) / (kernel_bandwidth*kernel_bandwidth));
It is maybe a stupid question but I really want to know which one is correct?
Best regards
Wei
thanks for sharing, but when i compile there is an error!
in the cpp_test.cpp, in line 49, your code is
vector<vector > shifted_points = msp->cluster(points, kernel_bandwidth);
but your cluster funtion returns vector, so i changed to the following:
vector<vector > shifted_points = msp->cluster(points, kernel_bandwidth)[0] .support;
and i can change 0 to 1 also, the result is different, i think this is a big error
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.