Coder Social home page Coder Social logo

stephenbeckr / sparsifiedkmeans Goto Github PK

View Code? Open in Web Editor NEW
56.0 56.0 46.0 1.29 MB

KMeans for big data using preconditioning and sparsification, Matlab implementation. Aka k-means

License: MIT License

MATLAB 71.34% C 28.66%
k-means kmeans out-of-core

sparsifiedkmeans's People

Contributors

stephenbeckr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sparsifiedkmeans's Issues

can't run 'example_loadFromDisk.m'

Hello, when I try to run your demo, I have come across a problem. When I run the file 'example_loadFromDisk.m', the bug shows that Y = [Y Yj]; in file sampleAndMixFromLargeFile.m that the dim of Y and Yj is not equal. Could you help me with this problem? Thanks a lot.

Compile error of 'hadamard_pthreads.c'

Hey, dear stephen
When I run 'setup_kmeans', 'hadamard_pthreads.c' can't compile successfully, because “pthread.h”: No such file or directory.
Can you tell me if it is a real missing file or I can simply remove this line from code?
Best regards.

FOR loop index is too large. Truncating to 9223372036854775807.

Hi!

I was using your sparsified kmeans and i think it is absolutely great. But i had encountered this error when using your code

Input: 5244949 x 35 in a mat file

Output: Splitting 5244949 x 35 matrix into Inf 5244949 x 0 chunks

The error code goes like this in matlab

`Warning: FOR loop index is too large. Truncating to 9223372036854775807.

In sampleAndMixFromLargeFile (line 96)
In kmeans_sparsified (line 301)
In example_loadFromDisk (line 55)
Error using sampleAndMixFromLargeFile (line 100)
Cannot index into 'X' because indices cannot be empty.

Error in kmeans_sparsified (line 301)
[X,timeLoad,timeMix,timeSample] = sampleAndMixFromLargeFile( DataFile, SparsityLevel, mix, p2,...

Error in example_loadFromDisk (line 55)
[indx,centers,sumd,dist_sketch] = kmeans_sparsified( [], k,'ColumnSamples',true,... '

I am using the loadfromDisk function but i've also tried using smaller values and it works like a charm.

small_p = 0 prevents code from running

To prevent small_p from being 0, maybe it's better to replace ln. 326 in kmeans_sparsified with:
small_p = max(1, round( SparsityLevel*p2 ));

(similarly ln. 323)

Customizing distance function in k-means algorithm

Hi~
I want to use a specific distance function (not provided in Matlab's original k-means) due to the structure of data I am dealing with. Since the distance function can simply be written as "distance = function(point_1, point_2)", I am wondering if customized distance function can be used in your wonderful implementation of K-means algorithm. Thank you~

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.