Skip to content

Commit bae9cbf

Browse files
committed
document details_k_means_klaR
1 parent 1ed42bc commit bae9cbf

File tree

6 files changed

+167
-0
lines changed

6 files changed

+167
-0
lines changed

R/k_means.R

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

R/k_means_klaR.R

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#' K-means via klaR
2+
#'
3+
#' [k_means()] creates K-Modes model. This model is intended to be used with
4+
#' categorical predictors. Although it will accept numeric predictors if they
5+
#' contain a few number of unique values. The numeric predictors will then be
6+
#' treated like categorical.
7+
#'
8+
#' @includeRmd man/rmd/k_means_klaR.md details
9+
#'
10+
#' @name details_k_means_klaR
11+
#' @keywords internal
12+
NULL
13+
14+
# See inst/README-DOCS.md for a description of how these files are processed

man/details_k_means_klaR.Rd

Lines changed: 63 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_klaR.Rmd

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
```{r, child = "aaa.Rmd", include = FALSE}
2+
```
3+
4+
`r descr_models("k_means", "klaR")`
5+
6+
## Tuning Parameters
7+
8+
```{r klaR-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("klaR") %>%
16+
set_mode("partition") %>%
17+
make_parameter_list(defaults)
18+
```
19+
20+
This model has `r nrow(param)` tuning parameters:
21+
22+
```{r klaR-param-list, echo = FALSE, results = "asis"}
23+
param$item
24+
```
25+
26+
## Translation from tidyclust to the original package (partition)
27+
28+
```{r klaR-cls}
29+
k_means(num_clusters = integer(1)) %>%
30+
set_engine("klaR") %>%
31+
set_mode("partition") %>%
32+
translate_tidyclust()
33+
```
34+
35+
## Preprocessing requirements
36+
37+
Only categorical variables are accepted, along with numerics with few unique values.
38+
39+
## References
40+
41+
- Huang, Z. (1997) A Fast Clustering Algorithm to Cluster Very Large Categorical Data Sets in Data Mining. in KDD: Techniques and Applications (H. Lu, H. Motoda and H. Luu, Eds.), pp. 21-34, World Scientific, Singapore.
42+
43+
- MacQueen, J. (1967) Some methods for classification and analysis of multivariate observations. In Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability, eds L. M. Le Cam & J. Neyman, 1, pp. 281-297. Berkeley, CA: University of California Press.

man/rmd/k_means_klaR.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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("klaR") %>%
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: klaR
31+
##
32+
## Model fit template:
33+
## tidyclust::.k_means_fit_klaR(data = missing_arg(), modes = missing_arg(),
34+
## modes = integer(1))
35+
```
36+
37+
## Preprocessing requirements
38+
39+
Only categorical variables are accepted, along with numerics with few unique values.
40+
41+
## References
42+
43+
- Huang, Z. (1997) A Fast Clustering Algorithm to Cluster Very Large Categorical Data Sets in Data Mining. in KDD: Techniques and Applications (H. Lu, H. Motoda and H. Luu, Eds.), pp. 21-34, World Scientific, Singapore.
44+
45+
- MacQueen, J. (1967) Some methods for classification and analysis of multivariate observations. In Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability, eds L. M. Le Cam & J. Neyman, 1, pp. 281-297. Berkeley, CA: University of California Press.

0 commit comments

Comments
 (0)