Skip to content

Commit 14a66b4

Browse files
committed
document details_k_means_clustMixType
1 parent bae9cbf commit 14a66b4

File tree

6 files changed

+174
-0
lines changed

6 files changed

+174
-0
lines changed

R/k_means.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#' - \link[=details_k_means_stats]{stats}: Classical K-means
1414
#' - \link[=details_k_means_ClusterR]{ClusterR}: Classical K-means
1515
#' - \link[=details_k_means_klaR]{klaR}: K-Modes
16+
#' - \link[=details_k_means_clustMixType]{clustMixType}: K-prototypes
1617
#'
1718
#' @param mode A single character string for the type of model. The only
1819
#' possible value for this model is "partition".

R/k_means_clustMixType.R

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#' K-means via clustMixType
2+
#'
3+
#' [k_means()] creates K-prototypes model. A K-prototypes is the middle ground
4+
#' between a K-means and K-modes model, in the sense that it can be used with
5+
#' data that contains both numeric and categorical predictors.
6+
#'
7+
#' Both numeric and categorical predictors are requires for this engine.
8+
#'
9+
#' @includeRmd man/rmd/k_means_clustMixType.md details
10+
#'
11+
#' @name details_k_means_clustMixType
12+
#' @keywords internal
13+
NULL
14+
15+
# See inst/README-DOCS.md for a description of how these files are processed

man/details_k_means_clustMixType.Rd

Lines changed: 64 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/k_means.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/rmd/k_means_clustMixType.Rmd

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
```{r, child = "aaa.Rmd", include = FALSE}
2+
```
3+
4+
`r descr_models("k_means", "clustMixType")`
5+
6+
## Tuning Parameters
7+
8+
```{r clustMixType-param-info, echo = FALSE}
9+
defaults <-
10+
tibble::tibble(tidyclust = c("num_clusters"),
11+
default = c("no default"))
12+
13+
param <-
14+
k_means() %>%
15+
set_engine("clustMixType") %>%
16+
set_mode("partition") %>%
17+
make_parameter_list(defaults)
18+
```
19+
20+
This model has `r nrow(param)` tuning parameters:
21+
22+
```{r clustMixType-param-list, echo = FALSE, results = "asis"}
23+
param$item
24+
```
25+
26+
## Translation from tidyclust to the original package (partition)
27+
28+
```{r clustMixType-cls}
29+
k_means(num_clusters = integer(1)) %>%
30+
set_engine("clustMixType") %>%
31+
set_mode("partition") %>%
32+
translate_tidyclust()
33+
```
34+
35+
## Preprocessing requirements
36+
37+
Both categorical and numeric predictors are required.
38+
39+
## References
40+
41+
- Szepannek, G. (2018): clustMixType: User-Friendly Clustering of Mixed-Type Data in R, The R Journal 10/2, 200-208, doi:10.32614/RJ-2018-048.
42+
43+
- Aschenbruck, R., Szepannek, G., Wilhelm, A. (2022): Imputation Strategies for Clustering Mixed‑Type Data with Missing Values, Journal of Classification, doi:10.1007/s00357-022-09422-y.
44+
45+
- Z.Huang (1998): Extensions to the k-Means Algorithm for Clustering Large Data Sets with Categorical Variables, Data Mining and Knowledge Discovery 2, 283-304.

man/rmd/k_means_clustMixType.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
3+
4+
For this engine, there is a single mode: partition
5+
6+
## Tuning Parameters
7+
8+
9+
10+
This model has 1 tuning parameters:
11+
12+
- `num_clusters`: # Clusters (type: integer, default: no default)
13+
14+
## Translation from tidyclust to the original package (partition)
15+
16+
17+
```r
18+
k_means(num_clusters = integer(1)) %>%
19+
set_engine("clustMixType") %>%
20+
set_mode("partition") %>%
21+
translate_tidyclust()
22+
```
23+
24+
```
25+
## K Means Cluster Specification (partition)
26+
##
27+
## Main Arguments:
28+
## num_clusters = integer(1)
29+
##
30+
## Computational engine: clustMixType
31+
##
32+
## Model fit template:
33+
## tidyclust::.k_means_fit_clustMixType(x = missing_arg(), k = missing_arg(),
34+
## keep.data = missing_arg(), k = integer(1), keep.data = TRUE,
35+
## verbose = FALSE)
36+
```
37+
38+
## Preprocessing requirements
39+
40+
Both categorical and numeric predictors are required.
41+
42+
## References
43+
44+
- Szepannek, G. (2018): clustMixType: User-Friendly Clustering of Mixed-Type Data in R, The R Journal 10/2, 200-208, doi:10.32614/RJ-2018-048.
45+
46+
- Aschenbruck, R., Szepannek, G., Wilhelm, A. (2022): Imputation Strategies for Clustering Mixed‑Type Data with Missing Values, Journal of Classification, doi:10.1007/s00357-022-09422-y.
47+
48+
- Z.Huang (1998): Extensions to the k-Means Algorithm for Clustering Large Data Sets with Categorical Variables, Data Mining and Knowledge Discovery 2, 283-304.

0 commit comments

Comments
 (0)