View source: R/clustering_algorithms.R
| DBSCANClustering | R Documentation |
Runs Density-Based Spatial Clustering of Applications with Noise (DBSCAN)
clustering using implementation from dbscan. This is
also known as the k-medoids algorithm. If Lambda is provided,
clustering is applied on the weighted distance matrix calculated using the
COSA algorithm as implemented in cosa2. Otherwise,
distances are calculated using dist. This function is
not using stability.
DBSCANClustering(
xdata,
nc = NULL,
eps = NULL,
Lambda = NULL,
distance = "euclidean",
...
)
xdata |
data matrix with observations as rows and variables as columns. |
nc |
matrix of parameters controlling the number of clusters in the
underlying algorithm specified in |
eps |
radius in density-based clustering, see
|
Lambda |
vector of penalty parameters (see argument |
distance |
character string indicating the type of distance to use. If
|
... |
additional parameters passed to |
A list with:
comembership |
an array of binary and symmetric co-membership matrices. |
weights |
a matrix of median weights by feature. |
rCOSAsharp
\insertRefCOSAsharp
Other clustering algorithms:
GMMClustering(),
HierarchicalClustering(),
KMeansClustering(),
PAMClustering()
if (requireNamespace("dbscan", quietly = TRUE)) {
# Data simulation
set.seed(1)
simul <- SimulateClustering(n = c(10, 10), pk = 50)
plot(simul)
# DBSCAN clustering
myclust <- DBSCANClustering(
xdata = simul$data,
eps = seq(0, 2 * sqrt(ncol(simul$data) - 1), by = 0.1)
)
# Weighted PAM clustering (using COSA)
if (requireNamespace("rCOSA", quietly = TRUE)) {
myclust <- DBSCANClustering(
xdata = simul$data,
eps = c(0.25, 0.5, 0.75),
Lambda = c(0.2, 0.5)
)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.