numberclust_table: Compute most important indices for best number of clusters in...

View source: R/FleetSegmentation.R

numberclust_tableR Documentation

Compute most important indices for best number of clusters in table format

Description

The fleet segmentation package uses the the average silhouettes, the Mantel test, the Davis-Bouldin index, the SD-index and the Calinski-Harabasz index. This function gives the values of those indices for the given maximal number of clusters in a table, which can be printed in a basic or html format or stored as a data frame. A modified (metric converted) Bray-Curtis distance matrix is computed from the input data, the clustering is performed as a hierarchical agglomerative clustering (HAC) using the average linkage link function.

Usage

numberclust_table(
  catchdata,
  max_clusternumber = ifelse(nrow(catchdata) <= 15, (nrow(catchdata) - 1), 15),
  style = "basic",
  distance = "jaccard",
  method = "average"
)

Arguments

catchdata

The transformed catchdata created with catchdata_transformation()

max_clusternumber

The maximum number of clusters to be expected. Defaults to 1 less than the number of ships in the catchdata-frame, up to a maximum of 15.

style

The output style, defaults to 'basic', which prints a data frame in the console and can be stored. For a html-version, use 'html'

distance

The distance measure used. Defaults to modified (metric conversion) Bray-Curtis distance distance. CAUTION! The clustering approach for the fleet segmentation is designed to work with modified (metric-converted) Bray-Curtis distance and the average linkage method! Changing either of them is not advised!

method

The link function used. Defaults to average linkage. CAUTION! The clustering approach for the fleet segmentation is designed to work with modified (metric-converted) Bray-Curtis distance and the average linkage method! Changing either of them is not advised!

Examples

library(tidyverse)
data <- example_catchdata
stockdata <- assign_stocks(data=data)
catchdata <- catchdata_transformation(data = stockdata)
clustering <- segmentation_clustering(catchdata = catchdata,n_cluster = 6)
numberclust_table(catchdata = catchdata,max_clusternumber = 15)
numberclust_table(catchdata = catchdata,max_clusternumber = 15,style = "html")
optclust_table <- numberclust_table(catchdata = catchdata,max_clusternumber = 15)

ESulanke/FleetSegmentation documentation built on March 27, 2023, 10:13 p.m.