Type: | Package |
Depends: | R (≥ 3.5.0) |
Title: | Whale Optimization Algorithm for K-Medoids Clustering |
Version: | 0.1.0 |
Date: | 2024-08-03 |
Encoding: | UTF-8 |
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>. |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Imports: | dtwclust, proxy, cluster, Rcpp (≥ 1.0.11) |
LinkingTo: | Rcpp |
RoxygenNote: | 7.2.1 |
LazyData: | true |
NeedsCompilation: | yes |
Packaged: | 2024-08-24 11:56:39 UTC; chan |
Author: | Chenan Huang [aut, cre],
Narumasa Tsutsumida
|
Maintainer: | Chenan Huang <hualianchan@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2024-08-28 08:50:02 UTC |
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
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
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)