Skip to content

Instantly share code, notes, and snippets.

@taroyabuki
Last active December 13, 2015 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taroyabuki/4995604 to your computer and use it in GitHub Desktop.
Save taroyabuki/4995604 to your computer and use it in GitHub Desktop.
Bug in Agglomerate of Mathematica 8.0.4 and 9.0.1.
Needs["HierarchicalClustering`"]
data = Import["https://gist.github.com/taroyabuki/4749183/raw/ffc84dbc4a3499ddef4a8c4f689b56c2948225bd/clustering_test_data.csv"];
clusters = Agglomerate[data, DistanceFunction -> CosineDistance, Linkage -> "Complete"];
On[Assert];
Assert[Length@ClusterFlatten@clusters == Length@data]
{Length@ClusterFlatten@clusters, Length@data}
(* {38, 63} *)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment