Comments (9)
This might be related. I keep getting this error when trying to run kmedoids
julia> kmedoids(mat, 8)
ERROR: AssertionError: !(isempty(grp))
in _find_medoid at /root/.julia/v0.4/Clustering/src/kmedoids.jl:189
in _kmedoids! at /root/.julia/v0.4/Clustering/src/kmedoids.jl:100
in kmedoids at /root/.julia/v0.4/Clustering/src/kmedoids.jl:39
mat
is a distance matrix.
from clustering.jl.
I think @lendle may be the main person who knows about this code.
from clustering.jl.
The k-medoids code was rewritten by @cyocum in #22.
from clustering.jl.
I just looked at the implementation and docs. C is actually an n x n matrix (not k x n).
The docs say "C – The cost matrix, where C[i,j] is the cost of assigning sample j to the medoid i" is a bit unclear. The ith row does correspond to the ith medoid for i = 1, ..., k, but corresponds to the cost associated with assigning each sample to a medoid defined by sample i for i = 1, ..., n.
@waTeim, would "C – The cost matrix, where C[i,j] is the cost of assigning sample j to a cluster with medoid sample i" be more clear?
from clustering.jl.
I don't think so. Are you sure because that approach has a lot of problems. It's not really the algorithm as documented in Wikipedia, it should be kxn and be re-calculated every iteration because the medoids can change. If it's nxn then that becomes unusable because take for instance how I was going to use it -- 90,000 data points gives rise to a 90000x90000 matrix which uses up more memory that the machine I have to run it on (40 GB RAM), and frankly that's kinda small compared to todays dataset sizes.
from clustering.jl.
The current approach takes as input a pre-computed pairwise cost matrix. When n is very large, one should use a different algorithm.
from clustering.jl.
Yea, that's more efficient if the number of rows^2 is storable, but in this case, nope. And like I said, this isn't even the largest of the datasets. I was looking around for a simple implementation of PAM to submit as a PR so there there would be options, but am stuck on the "compare cost of each non-medioid with a mediod cost and swap if lower" seems too inefficient to implement directly like that.
from clustering.jl.
@waTeim If your matrix is symmetric, maybe https://github.com/diegozea/PairwiseListMatrices.jl can be useful to you.
from clustering.jl.
This is an old question, that does not apply to the new distance-based API.
from clustering.jl.
Related Issues (20)
- Adjusted Rand Index inconsistency with Python's sklearn implementation HOT 1
- Adjacency-constrained hierarchical clustering? HOT 1
- AssertionError in kmedoids alg HOT 1
- TagBot trigger issue HOT 10
- conflict of "pairwise" in procedure `kmeans.jl` HOT 2
- Get WCSS (Within-Cluster Sum of Square) for optimal number of clusters in kmeans
- -1 silhouette score returned with empty classes HOT 1
- Docs not deployed for tags. HOT 3
- Unexpected behaviour of cutree - bug with :optimallayout? HOT 1
- Providing additional intrinsic evaluation metrices HOT 4
- Common clustering API (i.e., why aren't KShiftsClustering.jl, QuickShiftClustering.jl, QuickShiftClustering.jl SpectralClustering.jl here...?) HOT 7
- Fix warnings for latest Distances.jl HOT 1
- Hclust.order HOT 2
- Link to benchmarks from README?
- WARNING: both StatsBase and Distances export "pairwise!"; uses of it in module Clustering must be qualified HOT 10
- Is this package actively maintained? By who? HOT 2
- Computationally intensive quality measures, :dunn and :sillouette fail on large datasets HOT 1
- quality_index=:davis_bouldin or quality_index=:calinsky_harabasz not supported. HOT 3
- Unnecessary check of dimensions for input?
- AssertionError in K-medoids algorithm
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clustering.jl.