create_clustering {ClustAssess}R Documentation

Create Clustering Object

Description

Creates a Clustering object from the output of a clustering method.

Usage

create_clustering(clustering_result, ...)

## S4 method for signature 'numeric'
create_clustering(clustering_result, alpha = 0.9)

## S4 method for signature 'character'
create_clustering(clustering_result, alpha = 0.9)

## S4 method for signature 'factor'
create_clustering(clustering_result, alpha = 0.9)

## S4 method for signature 'matrix'
create_clustering(
  clustering_result,
  alpha = 0.9,
  ppr_implementation = "prpack",
  row_normalize = TRUE
)

## S4 method for signature 'Matrix'
create_clustering(
  clustering_result,
  alpha = 0.9,
  ppr_implementation = "prpack",
  row_normalize = TRUE
)

## S4 method for signature 'hclust'
create_clustering(
  clustering_result,
  alpha = 0.9,
  r = 1,
  rescale_path_type = "max",
  ppr_implementation = "prpack",
  dist_rescaled = FALSE
)

Arguments

clustering_result

The clustering result, either:

  • A numeric/character/factor vector of cluster labels for each element.

  • A samples x clusters matrix/Matrix::Matrix of nonzero membership values.

  • An hclust object.

...

This argument is not used.

alpha

A numeric giving the personalized PageRank damping factor; 1 - alpha is the restart probability for the PPR random walk.

ppr_implementation

Choose a implementation for personalized page-rank calcuation:

  • 'prpack': use PPR alogrithms in igraph.

  • 'power_iteration': use power_iteration method.

row_normalize

Whether to normalize all rows in clustering_result so they sum to one before calculating ECS. It is recommended to set this to TRUE, which will lead to slightly different ECS values compared to clusim.

r

A numeric hierarchical scaling parameter.

rescale_path_type

A string; rescale the hierarchical height by:

  • 'max' : the maximum path from the root.

  • 'min' : the minimum path form the root.

  • 'linkage' : use the linkage distances in the clustering.

dist_rescaled

A logical: if TRUE, the linkage distances are linearly rescaled to be in-between 0 and 1.

Value

A Clustering object.

Methods (by class)

Examples

km.res = kmeans(mtcars, 3)$cluster
km.clustering = create_clustering(km.res)
hc.res = hclust(dist(mtcars))
hc.clustering = create_clustering(hc.res)
element_sim(km.clustering, hc.clustering)

[Package ClustAssess version 0.1.1 Index]