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 |
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.
data(Lightning7)
data(Lightning7)
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.
UCR Time Series Classification Archive
Eads, Damian R., et al. "Genetic algorithms and support vector machines for time series classification." Applications and Science of Neural Networks, Fuzzy Systems, and Evolutionary Computation V. Vol. 4787. International Society for Optics and Photonics, 2002.
http://www.timeseriesclassification.com/description.php?Dataset=Lightning7
data(Lightning7) head(Lightning7)
data(Lightning7) head(Lightning7)
This function implements the Whale Optimization Algorithm (WOA) for K-Medoids clustering. Supported distance measures are Dynamic Time Warping (DTW) and Euclidean Distance (ED).
woa_kmedoids( data, ClusNum, distance_method = c("dtw", "ed"), learned_w = NULL, Max_iter = 20, n = 5 )
woa_kmedoids( data, ClusNum, distance_method = c("dtw", "ed"), learned_w = NULL, Max_iter = 20, n = 5 )
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) |
The 'woa_clustering' object containing the clustering result and medoids
Chenan Huang, Narumasa Tsutsumida
Mirjalili, S., & Lewis, A. (2016). The whale optimization algorithm. Advances in engineering software, 95, 51-67.
# 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)
# 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)