View source: R/FleetSegmentation.R
segmentation_clustering | R Documentation |
This is the core function to perform the clustering of the catchdata. Use the number of suitable number of clusters estimated with numberclust_table() and numberclust_plot(). 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. The function creates a new data frame, which can be printed or stored.
segmentation_clustering(
catchdata,
n_cluster,
distance = "jaccard",
method = "average"
)
catchdata |
The transformed catchdata created with catchdata_transformation() |
n_cluster |
The number of clusters to be generated. No default. |
distance |
The distance measure used. Defaults to modified (metric-converted) Bray-Curtis 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! |
library(tidyverse)
data <- example_catchdata
stockdata <- assign_stocks(data=data)
catchdata <- catchdata_transformation(data = stockdata)
clustering <- segmentation_clustering(catchdata = catchdata,n_cluster = 6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.