3 Clustering
using Rtemis
Get available clutering algorithms:
clustselect()
3.1 Data
iris = ddb_data("~/icloud/Data/iris.csv")
Create a 2D projection for plotting of clustering results using a 2D scatter
iris_umap = d_UMAP(iris[:, 1:4], 2)
3.2 K-means
iris_kmeans = c_KMEANS(iris[:, 1:4], 3);
dplot3_xy(
iris_umap.projections_train[:, 1],
iris_umap.projections_train[:, 2],
group = iris_kmeans.clusters,
trace_names = ["K-means"])
3.3 K-medoids
iris_kmedoids = c_KMEDOIDS(iris[:, 1:4], 3);
dplot3_xy(
iris_umap.projections_train[:, 1],
iris_umap.projections_train[:, 2],
group = iris_kmedoids.clusters,
trace_names = ["K-medoids"])
3.4 Fuzzy C-Means
iris_cmeans = c_CMEANS(iris[:, 1:4], 3,
fuzziness=14, trace=1);
dplot3_xy(
iris_umap.projections_train[:, 1],
iris_umap.projections_train[:, 2],
group = iris_cmeans.clusters,
trace_names = ["C-means"])
dplot3_xy(
iris_umap.projections_train[:, 1],
iris_umap.projections_train[:, 2],
group = iris_cmeans.clusters,
trace_names = ["C-means"])
3.5 DBSCAN
iris_dbscan = c_DBSCAN(iris[:, 1:4])
dplot3_xy(
iris_umap.projections_train[:, 1],
iris_umap.projections_train[:, 2],
group = iris_dbscan.clusters,
trace_names = ["DBSCAN"])
3.6 MCL
iris_mcl = c_MCL(iris[:, 1:4])
dplot3_xy(
iris_umap.projections_train[:, 1],
iris_umap.projections_train[:, 2],
group = iris_mcl.clusters,
trace_names = ["MCL"],
palette = repeat(Rtemis.rtcol3, 4))