Skip to content

Commit ffac322

Browse files
Merge pull request #171 from tidymodels/RC-0.2.0
2 parents 344796e + a6af088 commit ffac322

15 files changed

+3553
-3428
lines changed

.Rbuildignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212
^vignettes/articles$
1313
^cran-comments\.md$
1414
^CRAN-SUBMISSION$
15+
^revdep$

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@
55
.DS_Store
66
docs
77
hex sticker/
8+
revdep/checks.noindex
9+
revdep/library.noindex
10+
revdep/data.sqlite
11+
.httr-oauth
12+
revdep/cloud.noindex/*

DESCRIPTION

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: tidyclust
22
Title: A Common API to Clustering
3-
Version: 0.1.2.9000
3+
Version: 0.2.0.9000
44
Authors@R: c(
55
person("Emil", "Hvitfeldt", , "[email protected]", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0002-0679-1945")),
@@ -13,6 +13,8 @@ Description: A common interface to specifying clustering models, in the
1313
License: MIT + file LICENSE
1414
URL: https://github.com/tidymodels/tidyclust, https://tidyclust.tidymodels.org/
1515
BugReports: https://github.com/tidymodels/tidyclust/issues
16+
Depends:
17+
R (>= 3.6)
1618
Imports:
1719
cli (>= 3.0.0),
1820
dials (>= 1.1.0),

NEWS.md

+19-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# tidyclust (development version)
22

3+
# tidyclust 0.2.0
4+
5+
## New Engines
6+
7+
* The clustMixType engine as been added to `k_means()`. This engine allows fitting of k-prototype models. (#63)
8+
9+
* The klaR engine as been added to `k_means()`. This engine allows fitting of k-modes models. (#63)
10+
11+
## Improvements
12+
13+
* Engine specific documentation has been added for all models and engines. (#159)
14+
15+
## Bug Fixes
16+
317
* Fixed bug where engine specific arguments were passed along for `k_means()` when the engine ClusterR. (#142)
418

519
* Fixed bug where `prefix` argument wouldn't be correctly passed through `extract_cluster_assignment()`, `extract_centroids()`, and `predict()` (#145)
@@ -12,19 +26,15 @@
1226

1327
* `k_means()` now errors informatively if `fit()` without `num_clust` specified. (#134)
1428

15-
* Exported internal functions `ClusterR_kmeans_fit()`, `stats_kmeans_fit()`, and `hclust_fit()` have been renamed to `.k_means_fit_ClusterR()`, `.k_means_fit_stats()`, and `.hier_clust_fit_stats()` to reduce visibility for users.
16-
17-
* The clustMixType engine as been added to `k_means()`. This engine allows fitting of k-prototype models. (#63)
29+
* Fixed bug where levels didn't match number of clusters if prediction on fewer number of observations. (#158)
1830

19-
* The klaR engine as been added to `k_means()`. This engine allows fitting of k-modes models. (#63)
31+
* Fixed bug where `tune_cluster()` would error if used with an recipe that contained non-predictor variables such as id variables. (#124)
2032

21-
* Cluster reordering is now done at the fitting time, not the extraction and prediction time. (#154)
33+
## Breaking Changes
2234

23-
* Engine specific documentation has been added for all models and engines. (#159)
24-
25-
* Fixed bug where levels didn't match number of clusters if prediction on fewer number of observations. (#158)
35+
* Exported internal functions `ClusterR_kmeans_fit()`, `stats_kmeans_fit()`, and `hclust_fit()` have been renamed to `.k_means_fit_ClusterR()`, `.k_means_fit_stats()`, and `.hier_clust_fit_stats()` to reduce visibility for users.
2636

27-
* Fixed bug where `tune_cluster()` would error if used with an recipe that contained non-predictor variables such as id variables. (#124)
37+
* Cluster reordering is now done at the fitting time, not the extraction and prediction time. (#154)
2838

2939
# tidyclust 0.1.2
3040

R/engine_docs.R

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#' Knit engine-specific documentation
44
#' @param pattern A regular expression to specify which files to knit. The
55
#' default knits all engine documentation files.
6-
#' @param ... Options passed to [knitr::knit()].
76
#' @return A tibble with column `file` for the file name and `result` (a
87
#' character vector that echos the output file name or, when there is
98
#' a failure, the error message).

R/hier_clust.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ translate_tidyclust.hier_clust <- function(x, engine = x$engine, ...) {
171171
#'
172172
#' @param x matrix or data frame
173173
#' @param num_clusters the number of clusters
174-
#' @param h the height to cut the dendrogram
174+
#' @param cut_height the height to cut the dendrogram
175175
#' @param linkage_method the agglomeration method to be used. This should be (an
176176
#' unambiguous abbreviation of) one of `"ward.D"`, `"ward.D2"`, `"single"`,
177177
#' `"complete"`, `"average"` (= UPGMA), `"mcquitty"` (= WPGMA), `"median"` (=

README.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ library(tidyclust)
4141
set.seed(1234)
4242

4343
kmeans_spec <- k_means(num_clusters = 3) %>%
44-
set_engine("stats")
44+
set_engine("stats")
4545

4646
kmeans_spec
4747
#> K Means Cluster Specification (partition)
@@ -60,38 +60,38 @@ kmeans_spec_fit <- kmeans_spec %>%
6060
kmeans_spec_fit
6161
#> tidyclust cluster object
6262
#>
63-
#> K-means clustering with 3 clusters of sizes 7, 14, 11
63+
#> K-means clustering with 3 clusters of sizes 7, 11, 14
6464
#>
6565
#> Cluster means:
6666
#> mpg cyl disp hp drat wt qsec vs
6767
#> 1 19.74286 6 183.3143 122.28571 3.585714 3.117143 17.97714 0.5714286
68-
#> 2 15.10000 8 353.1000 209.21429 3.229286 3.999214 16.77214 0.0000000
6968
#> 3 26.66364 4 105.1364 82.63636 4.070909 2.285727 19.13727 0.9090909
69+
#> 2 15.10000 8 353.1000 209.21429 3.229286 3.999214 16.77214 0.0000000
7070
#> am gear carb
7171
#> 1 0.4285714 3.857143 3.428571
72-
#> 2 0.1428571 3.285714 3.500000
7372
#> 3 0.7272727 4.090909 1.545455
73+
#> 2 0.1428571 3.285714 3.500000
7474
#>
7575
#> Clustering vector:
7676
#> Mazda RX4 Mazda RX4 Wag Datsun 710 Hornet 4 Drive
77-
#> 1 1 3 1
77+
#> 1 1 2 1
7878
#> Hornet Sportabout Valiant Duster 360 Merc 240D
79-
#> 2 1 2 3
79+
#> 3 1 3 2
8080
#> Merc 230 Merc 280 Merc 280C Merc 450SE
81-
#> 3 1 1 2
81+
#> 2 1 1 3
8282
#> Merc 450SL Merc 450SLC Cadillac Fleetwood Lincoln Continental
83-
#> 2 2 2 2
83+
#> 3 3 3 3
8484
#> Chrysler Imperial Fiat 128 Honda Civic Toyota Corolla
85-
#> 2 3 3 3
86-
#> Toyota Corona Dodge Challenger AMC Javelin Camaro Z28
8785
#> 3 2 2 2
88-
#> Pontiac Firebird Fiat X1-9 Porsche 914-2 Lotus Europa
86+
#> Toyota Corona Dodge Challenger AMC Javelin Camaro Z28
8987
#> 2 3 3 3
88+
#> Pontiac Firebird Fiat X1-9 Porsche 914-2 Lotus Europa
89+
#> 3 2 2 2
9090
#> Ford Pantera L Ferrari Dino Maserati Bora Volvo 142E
91-
#> 2 1 2 3
91+
#> 3 1 3 2
9292
#>
9393
#> Within cluster sum of squares by cluster:
94-
#> [1] 13954.34 93643.90 11848.37
94+
#> [1] 13954.34 11848.37 93643.90
9595
#> (between_SS / total_SS = 80.8 %)
9696
#>
9797
#> Available components:
@@ -132,7 +132,7 @@ extract_cluster_assignment(kmeans_spec_fit)
132132
#> 8 Cluster_2
133133
#> 9 Cluster_2
134134
#> 10 Cluster_1
135-
#> # … with 22 more rows
135+
#> # 22 more rows
136136
```
137137

138138
and `extract_centroids()` returns the locations of the clusters

cran-comments.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Comments
22

3-
Patch release to make sure `utils::packageVersion()` doesn't cause issues when package isn't available.
3+
Release including fix for all known bugs, new engines and better document and error messages.
44

55
## R CMD check results
66

man/dot-hier_clust_fit_stats.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)