Package 'WOAkMedoids'

Title: Whale Optimization Algorithm for K-Medoids Clustering
Description: Implements the Whale Optimization Algorithm(WOA) for k-medoids clustering, providing tools for effective and efficient cluster analysis in various data sets. The methodology is based on "The Whale Optimization Algorithm" by Mirjalili and Lewis (2016) <doi:10.1016/j.advengsoft.2016.01.008>.
Authors: Chenan Huang [aut, cre], Narumasa Tsutsumida [aut]
Maintainer: Chenan Huang <[email protected]>
License: GPL (>= 2)
Version: 0.1.0
Built: 2024-11-27 06:50:55 UTC
Source: CRAN

Help Index


Lightning7 Data for Testing

Description

A dataset containing example data for testing purposes from the UCR Time Series Classification Archive. This dataset is a time series dataset with correct classifications in the first column. There are 7 classes in this dataset. It contains 73 series, each with 319 time points, and the best DTW window length for this dataset is 5.

Usage

data(Lightning7)

Format

A data frame with 73 rows and 320 columns. The first column (V1) is a factor vector of correct classifications, and the remaining 319 columns (V2 to V320) are numeric vectors of time series data.

Source

UCR Time Series Classification Archive

References

Examples

data(Lightning7)
head(Lightning7)

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)