clarans_clust: CLARANS clustering

Description Usage Arguments Value Examples

View source: R/main.R

Description

With the help of TraMineR package, CLARANS clustering provide a clustering of big dataset.
The main objective is to cluster state sequences with the "LCS" distance calculation method to find the best partition in N clusters.

WARNING : this function is less efficient than cLARA.

Usage

1
2
3
4
5
6
7
8
9
clarans_clust(
  data,
  nb_cluster,
  distargs = list(method = "LCS"),
  maxneighbours,
  numlocal,
  plot = FALSE,
  cores = detectCores() - 1
)

Arguments

data

The dataset to use. In case of sequences, use seqdef (from TraMineR package) to create such an object.

nb_cluster

The number of medoids

distargs

List with method parameters to apply. (See the function seqdist in TraMineR package)

maxneighbours

Number of neighbours to explore to find a better clustering

numlocal

Number of initialisation of the starting medoids

plot

Boolean variable to plot the research convergence

cores

Number of cores to use for parallelism

Value

An object of class clarans_seq

Examples

1
2
3
4
5
6
7
8
9
#creating sequences
library(TraMineR)
data(mvad)
mvad.labels <- c("employment", "further education", "higher education","joblessness", "school", "training")
mvad.scode <- c("EM", "FE", "HE", "JL", "SC", "TR")
mvad.seq <- seqdef(mvad, 17:86, states = mvad.scode,abels = mvad.labels, xtstep = 6)

#CLARANS Clustering
my_cluster <- clarans_clust(mvad.seq,nb_cluster = 4, maxneighbours = 20, numlocal = 4, plot = TRUE)

Ltochon/CLARA.seq documentation built on Dec. 17, 2021, 1:12 a.m.