letiantian / kmedoids Goto Github PK
View Code? Open in Web Editor NEW[Unmaintained] The Python implementation of k-medoids.
[Unmaintained] The Python implementation of k-medoids.
Hey, thank you for sharing this code !
Can the algorithm handle a matrix of distances where dist(A->B) != dist(B->A)
?
i.e. an asymmetric distance matrix.
Thank you !
Traceback (most recent call last):
File "C:/Users/AP/PycharmProjects/Btech_proj/kmedoid.py", line 24, in
for point_idx in C[label]:
TypeError: 'numpy.int32' object is not iterable
for t in xrange(tmax):
NameError: name 'xrange' is not defined
I could not install this kmedoids package. Anyone please help me?Thanks
what is the tmax varaible for? and why did u set it to 100?
if i have a dataset of 800 points should i put tmax=800?
This error only occurs sometimes.
I think when a cluster size is zero this happens. When trying to get the min of an empty array.
line 29, in kMedoids j = np.argmin(J)
Stack trace -
`F:\Programs\Anaconda3\lib\site-packages\numpy\core_methods.py:59: RuntimeWarning: Mean of empty slice.
warnings.warn("Mean of empty slice.", RuntimeWarning)
Traceback (most recent call last):
File "", line 1, in
runfile('D:/University/FYP/code/fyp_scritps/clustering/phrase_cluster.py', wdir='D:/University/FYP/code/fyp_scritps/clustering')
File "F:\Programs\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 880, in runfile
execfile(filename, namespace)
File "F:\Programs\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "D:/University/FYP/code/fyp_scritps/clustering/phrase_cluster.py", line 43, in
M, C = kmedoids.kMedoids(D, 2)
File "D:\University\FYP\code\fyp_scritps\clustering\kmedoids\kmedoids.py", line 29, in kMedoids
j = np.argmin(J)
File "F:\Programs\Anaconda3\lib\site-packages\numpy\core\fromnumeric.py", line 1033, in argmin
return argmin(axis, out)
File "F:\Programs\Anaconda3\lib\site-packages\numpy\matrixlib\defmatrix.py", line 895, in argmin
return N.ndarray.argmin(self, axis, out)._align(axis)
ValueError: attempt to get argmin of an empty sequence`
Hi, I tried to get the kMedoids function to work on the provided example but when running the following line:
# split into 2 clusters
M, C = kMedoids(D, 2)
I get the following error:
Traceback (most recent call last):
File "/usr/lib/python3.5/code.py", line 91, in runcode
exec(code, self.locals)
File "", line 1, in
File "", line 9, in kMedoids
File "mtrand.pyx", line 4832, in mtrand.RandomState.shuffle
File "mtrand.pyx", line 4835, in mtrand.RandomState.shuffle
TypeError: 'range' object does not support item assignment
Any idea what is causing this? Should it work on Python 3.5?
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.