GithubHelp home page GithubHelp logo

pyclust's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m Vahid Mirjalili, a machine learning research scientist.
  • I obtained my PhD in computer science at Michigan State University.
  • ๐Ÿ‘€ Iโ€™m interested in deep learning, computer vision and NLP.
  • ๐ŸŒฑ https://linktr.ee/vmirly

pyclust's People

Contributors

deeper-learning avatar mirjalil avatar vmirly 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

Watchers

 avatar  avatar  avatar  avatar

pyclust's Issues

"ValueError: a must be greater than 0" in _kmeans_init np.random.choice

I am getting a ValueError: a must be greater than 0 after fitting my TFIDF matrix (shape = (19134, 179)). It's happening when _bisect_kmeans calls km.fit, and the error occurs in the _kmeans_init part of the code, where np.random.choice is being used.

I inserted print n_samples under the definition of n_samples in _kmeans_init, and I get this:

19134
19134
19134
19134
19134
19134
19134
19134
19134
19134
12765
12765
12765
12765
12765
12765
12765
12765
12765
12765
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
9838
0

And then the error is raised.

k-medoid, ValueError: attempt to get argmin of an empty sequence

I am having numpy array below is the sample, and i want to do k-medoid clustering on it and Iโ€™m getting ValueError: attempt to get argmin of an empty sequence. This is happening according to me because some rows are having zero value. Please help. Thank you.

type: <class 'numpy.ndarray'>
array([[ 1.00000000e+00, 6.15385000e+00],
[ 1.30000000e+01, 3.44615000e+00],
[ 1.00000000e-04, 0.00000000e+00],
...,
[ 1.00000000e-04, 0.00000000e+00],
[ 1.00000000e-04, 0.00000000e+00],
[ 1.00000000e-04, 0.00000000e+00]])

Solved python2.7 import error

In python2.7, from . import _kmeans in file _bisect_kmeans.py will raise error ImportError: cannot import name _kmeans. This error can be solved by change from . import _kmeans into import _kmeans.
FYI. ๐Ÿ˜‰

How to use

Hi there !

I can't find a "how to use" file in all of the repository. Is there any way to get this ?

Looking for more clusters returns a `ValueError`

I run kmedoids with (abridged) :

    k = 30
    kmd = pyclust.KMedoids(n_clusters=k, n_trials=10)
    kmd.fit(data) # data is 10k points in dim 100, word representations

And all goes fine with k = 30, but running the same with k = 100 gives :

Traceback (most recent call last): 
[...]
    kmd.fit(data)
  File "/home/will/.local/lib/python3.6/site-packages/pyclust/_kmedoids.py", line 131, in fit
    _kmedoids(X, self.n_clusters, self.distance, self.max_iter, self.n_trials, self.tol)
  File "/home/will/.local/lib/python3.6/site-packages/pyclust/_kmedoids.py", line 62, in _kmedoids
    _kmedoids_run(X, n_clusters, distance, max_iter, tol)
  File "/home/will/.local/lib/python3.6/site-packages/pyclust/_kmedoids.py", line 42, in _kmedoids_run
    centers,sse_arr = _update_centers(X, membs, n_clusters, distance)
  File "/home/will/.local/lib/python3.6/site-packages/pyclust/_kmedoids.py", line 24, in _update_centers
    inx_min = np.argmin(dist)
  File "/usr/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 1033, in argmin
    return argmin(axis, out)
ValueError: attempt to get argmin of an empty sequence

Would you know why / what happens ?

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.