# Cassini
dsd <- DSD_mlbenchGenerator("cassini")
# tNN has a built in micro and micro-clusterer
tnn <- DSC_tNN(r=.2, k=3, alpha=.08, lambda=0)
cluster(tnn, dsd, 500)
# see micro-clusters
nclusters(tnn)
head(get_centers(tnn))
# see macro-clusters
nclusters(tnn, type="macro")
get_centers(tnn, type="macro")
# see how micro and macro-clusters relate
# each microcluster has an entry with the macro-cluster id
# Note: unassigned micro-clusters (noise) have an NA
microToMacro(tnn)
# plot micro-clusters
plot(tnn, dsd)
# plot macro-clusters
plot(tnn, dsd, type="macro")
# evaluate first using macro and then using micro-clusters
evaluate(tnn, dsd, method="cRand")
evaluate(tnn, dsd, method="cRand", type="macro")
evaluate(tnn, dsd, method="cRand", type="macro", assign="macro")
Run the code above in your browser using DataLab