woa_kmedoids {WOAkMedoids}R Documentation

Whale Optimization Algorithm for K-Medoids Clustering

Description

This function implements the Whale Optimization Algorithm (WOA) for K-Medoids clustering. Supported distance measures are Dynamic Time Warping (DTW) and Euclidean Distance (ED).

Usage

woa_kmedoids(
  data,
  ClusNum,
  distance_method = c("dtw", "ed"),
  learned_w = NULL,
  Max_iter = 20,
  n = 5
)

Arguments

data

Data matrix

ClusNum

Number of clusters

distance_method

Distance calculation method, either "dtw" or "ed"

learned_w

Window size for DTW (only used if distance_method is "dtw")

Max_iter

Maximum number of iterations (default is 20, it can be adjusted according to the size of the dataset)

n

Population size (number of whales, default is 5, itcan be adjusted according to the size of the dataset)

Value

The 'woa_clustering' object containing the clustering result and medoids

Author(s)

Chenan Huang, Narumasa Tsutsumida

References

Mirjalili, S., & Lewis, A. (2016). The whale optimization algorithm. Advances in engineering software, 95, 51-67.

Examples

# NOTE: This example only shows how to implement woa_kmedoids using sample data.
# Results do not suggest any meanings.
data(Lightning7)
Lightning7_data <- Lightning7[, -1]  # Remove the first column of classification data
  result <- woa_kmedoids(Lightning7_data, ClusNum = 7, distance_method = "dtw", learned_w = 5)
  print(result)

[Package WOAkMedoids version 0.1.0 Index]