Skip to content

Instantly share code, notes, and snippets.

@Zhomart
Created October 15, 2014 05:24
Show Gist options
  • Save Zhomart/bb21c7fb13d50eef32df to your computer and use it in GitHub Desktop.
Save Zhomart/bb21c7fb13d50eef32df to your computer and use it in GitHub Desktop.
Example 3

# distances

aliens, point -> 96.05
rice, point -> 89.25
rice, aliens -> 99.56
planet, point -> 85.14
planet, aliens -> 95.46
planet, rice -> 97.71
earth, point -> 72.31
earth, aliens -> 94.56
earth, rice -> 95.02
earth, planet -> 79.17
kenes, point -> 99.99
kenes, aliens -> 100.0
kenes, rice -> 100.0
kenes, planet -> 100.0
kenes, earth -> 100.0


# distance matrix

0:
1: 96
2: 89 99
3: 85 95 97
4: 72 94 95 79
5: 99 100 99 99 99

# words
["point", "aliens", "rice", "planet", "earth", "kenes"]

# clusterization result [ <clusters>, <err>, <num of iterations> ]

[[4, 4, 2, 4, 4, 5], 246.0397702638325, 1]
[[4, 4, 2, 4, 4, 5], 246.0397702638325, 7]
[[4, 4, 2, 4, 4, 5], 246.0397702638325, 4]
[[4, 4, 2, 4, 4, 5], 246.0397702638325, 3]
[[4, 4, 2, 4, 4, 5], 246.0397702638325, 8]
[[4, 4, 2, 4, 4, 5], 246.0397702638325, 3]

[["point", "aliens", "planet", "earth"], ["rice"], ["kenes"]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment