data("Lsun3D")
Data=Lsun3D$Data
InputDistances=as.matrix(dist(Data))
projection=Pswarm(InputDistances)
## Example One
genUmatrixList=GeneratePswarmVisualization(Data,
projection$ProjectedPoints,projection$LC)
Cls=DBSclustering(k=3, Data,
genUmatrixList$Bestmatches, genUmatrixList$LC,PlotIt=TRUE)
## Example Two
#automatic Clustering without GeneralizedUmatrix visualization
Cls=DBSclustering(k=3, Data,
projection$ProjectedPoints, projection$LC[c(2,1)],PlotIt=TRUE)
if (FALSE) {
## Example Three
## Sometimes an automatic Clustering can be improved
## thorugh an interactive approach,
## e.g. if Outliers exist (see [Thrun/Ultsch, 2017])
library(ProjectionBasedClustering)
Cls2=ProjectionBasedClustering::interactiveClustering(genUmatrixList$Umatrix,
genUmatrixList$Bestmatches, Cls)
}
# \dontshow{
data2=matrix(runif(n = 100),10,10)
distance=as.matrix(dist(data2))
res2=Pswarm(distance,LC = c(10,12))
Cls=DBSclustering(k=2, data2,
res2$ProjectedPoints, res2$LC[c(2,1)],PlotIt=FALSE)
# }
Run the code above in your browser using DataLab