From 2c6b8ae857f24a72a738161445e86b9025192f05 Mon Sep 17 00:00:00 2001 From: brendad8 <72055001+brendad8@users.noreply.github.com> Date: Wed, 16 Apr 2025 10:38:02 -0700 Subject: [PATCH 1/9] db and gm clust tunable params --- NAMESPACE | 6 ++++++ R/param_circular.R | 16 ++++++++++++++++ R/param_min_points.R | 18 ++++++++++++++++++ R/param_radius.R | 18 ++++++++++++++++++ R/param_shared_orientation.R | 17 +++++++++++++++++ R/param_shared_shape.R | 17 +++++++++++++++++ R/param_shared_size.R | 16 ++++++++++++++++ R/param_zero_covariance.R | 16 ++++++++++++++++ man/circular.Rd | 17 +++++++++++++++++ man/dials-package.Rd | 2 +- man/min_points.Rd | 24 ++++++++++++++++++++++++ man/radius.Rd | 24 ++++++++++++++++++++++++ man/shared_shape.Rd | 18 ++++++++++++++++++ man/shared_size.Rd | 17 +++++++++++++++++ man/zero_covariance.Rd | 24 ++++++++++++++++++++++++ 15 files changed, 249 insertions(+), 1 deletion(-) create mode 100644 R/param_circular.R create mode 100644 R/param_min_points.R create mode 100644 R/param_radius.R create mode 100644 R/param_shared_orientation.R create mode 100644 R/param_shared_shape.R create mode 100644 R/param_shared_size.R create mode 100644 R/param_zero_covariance.R create mode 100644 man/circular.Rd create mode 100644 man/min_points.Rd create mode 100644 man/radius.Rd create mode 100644 man/shared_shape.Rd create mode 100644 man/shared_size.Rd create mode 100644 man/zero_covariance.Rd diff --git a/NAMESPACE b/NAMESPACE index 4214e39c..c077e8ed 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -53,6 +53,7 @@ export(adjust_deg_free) export(all_neighbors) export(batch_size) export(buffer) +export(circular) export(class_weights) export(conditional_min_criterion) export(conditional_test_statistic) @@ -103,6 +104,7 @@ export(max_times) export(max_tokens) export(min_dist) export(min_n) +export(min_points) export(min_times) export(min_unique) export(mixture) @@ -140,6 +142,7 @@ export(prior_terminal_node_expo) export(prod_degree) export(prune) export(prune_method) +export(radius) export(range_get) export(range_set) export(range_validate) @@ -163,6 +166,8 @@ export(sample_size) export(scale_factor) export(scale_pos_weight) export(select_features) +export(shared_shape) +export(shared_size) export(shrinkage_correlation) export(shrinkage_frequencies) export(shrinkage_variance) @@ -212,6 +217,7 @@ export(weight) export(weight_func) export(weight_scheme) export(window_size) +export(zero_covariance) import(rlang) importFrom(DiceDesign,dmaxDesign) importFrom(DiceDesign,lhsDesign) diff --git a/R/param_circular.R b/R/param_circular.R new file mode 100644 index 00000000..bfa9747c --- /dev/null +++ b/R/param_circular.R @@ -0,0 +1,16 @@ +#' Parameter to control circular or ellipsoidal cluster shapes +#' +#' Used in `tidyclust::gm_clust()`. +#' +#' @param values A vector of possible values (TRUE or FALSE). +#' @examples +#' circular() +#' @export +circular <- function(values = c(TRUE, FALSE)) { + new_qual_param( + type = "logical", + values = values, + label = c(circular = "Circular cluster shapes?"), + finalize = NULL + ) +} diff --git a/R/param_min_points.R b/R/param_min_points.R new file mode 100644 index 00000000..7c49a737 --- /dev/null +++ b/R/param_min_points.R @@ -0,0 +1,18 @@ +#' Minimum number of nearby points to be considered a core-point +#' +#' Used in `tidyclust::db_clust` model. +#' +#' @inheritParams Laplace +#' @examples +#' min_points() +#' @export +min_points <- function(range = c(3L, 50L), trans = NULL) { + new_quant_param( + type = "integer", + range = range, + inclusive = c(TRUE, TRUE), + trans = trans, + label = c(min_points = "Min Points"), + finalize = NULL + ) +} diff --git a/R/param_radius.R b/R/param_radius.R new file mode 100644 index 00000000..7113d194 --- /dev/null +++ b/R/param_radius.R @@ -0,0 +1,18 @@ +#' Radius used to determine core-points and cluster assignments +#' +#' Used in `tidyclust::db_clust`. +#' +#' @inheritParams Laplace +#' @examples +#' radius() +#' @export +radius <- function(range = c(-2, 2), trans = transform_log10()) { + new_quant_param( + type = "double", + range = range, + inclusive = c(TRUE, TRUE), + trans = trans, + label = c(radius = "Radius"), + finalize = NULL + ) +} diff --git a/R/param_shared_orientation.R b/R/param_shared_orientation.R new file mode 100644 index 00000000..c2e4d802 --- /dev/null +++ b/R/param_shared_orientation.R @@ -0,0 +1,17 @@ +#' Parameter to control whether clusters share the same orientation in the predictor space +#' (Only applicable if zero_covariance = FALSE) +#' +#' Used in `tidyclust::gm_clust()`. +#' +#' @param values A vector of possible values (TRUE or FALSE). +#' @examples +#' shared_orientation() +#' @export +zero_covariance <- function(values = c(TRUE, FALSE)) { + new_qual_param( + type = "logical", + values = values, + label = c(shared_orientation = "Shared orientation between clusters?"), + finalize = NULL + ) +} diff --git a/R/param_shared_shape.R b/R/param_shared_shape.R new file mode 100644 index 00000000..f003f71e --- /dev/null +++ b/R/param_shared_shape.R @@ -0,0 +1,17 @@ +#' Parameter to control whether clusters share the same shape in the predictor space +#' (Only applicable if circular = FALSE) +#' +#' Used in `tidyclust::gm_clust()`. +#' +#' @param values A vector of possible values (TRUE or FALSE). +#' @examples +#' shared_shape() +#' @export +shared_shape <- function(values = c(TRUE, FALSE)) { + new_qual_param( + type = "logical", + values = values, + label = c(shared_shape = "Shared shape between clusters?"), + finalize = NULL + ) +} diff --git a/R/param_shared_size.R b/R/param_shared_size.R new file mode 100644 index 00000000..e7de7a35 --- /dev/null +++ b/R/param_shared_size.R @@ -0,0 +1,16 @@ +#' Parameter to control whether clusters share the same size in the predictor space +#' +#' Used in `tidyclust::gm_clust()`. +#' +#' @param values A vector of possible values (TRUE or FALSE). +#' @examples +#' shared_size() +#' @export +shared_size <- function(values = c(TRUE, FALSE)) { + new_qual_param( + type = "logical", + values = values, + label = c(shared_size = "Shared size between clusters?"), + finalize = NULL + ) +} diff --git a/R/param_zero_covariance.R b/R/param_zero_covariance.R new file mode 100644 index 00000000..dae8d993 --- /dev/null +++ b/R/param_zero_covariance.R @@ -0,0 +1,16 @@ +#' Parameter to control whether clusters have zero covariance between predictors +#' +#' Used in `tidyclust::gm_clust()`. +#' +#' @param values A vector of possible values (TRUE or FALSE). +#' @examples +#' zero_covariance() +#' @export +zero_covariance <- function(values = c(TRUE, FALSE)) { + new_qual_param( + type = "logical", + values = values, + label = c(zero_covariance = "Zero covariance between predictors?"), + finalize = NULL + ) +} diff --git a/man/circular.Rd b/man/circular.Rd new file mode 100644 index 00000000..62a1103d --- /dev/null +++ b/man/circular.Rd @@ -0,0 +1,17 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/param_circular.R +\name{circular} +\alias{circular} +\title{Parameter to control circular or ellipsoidal cluster shapes} +\usage{ +circular(values = c(TRUE, FALSE)) +} +\arguments{ +\item{values}{A vector of possible values (TRUE or FALSE).} +} +\description{ +Used in \code{tidyclust::gm_clust()}. +} +\examples{ +circular() +} diff --git a/man/dials-package.Rd b/man/dials-package.Rd index 64667afe..e55736d9 100644 --- a/man/dials-package.Rd +++ b/man/dials-package.Rd @@ -53,7 +53,7 @@ Authors: Other contributors: \itemize{ - \item Posit Software, PBC (\href{https://ror.org/03wc8by49}{ROR}) [copyright holder, funder] + \item Posit Software, PBC (03wc8by49) [copyright holder, funder] } } diff --git a/man/min_points.Rd b/man/min_points.Rd new file mode 100644 index 00000000..078fb6a4 --- /dev/null +++ b/man/min_points.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/param_min_points.R +\name{min_points} +\alias{min_points} +\title{Minimum number of nearby points to be considered a core-point} +\usage{ +min_points(range = c(3L, 50L), trans = NULL) +} +\arguments{ +\item{range}{A two-element vector holding the \emph{defaults} for the smallest and +largest possible values, respectively. If a transformation is specified, +these values should be in the \emph{transformed units}.} + +\item{trans}{A \code{trans} object from the \code{scales} package, such as +\code{scales::transform_log10()} or \code{scales::transform_reciprocal()}. If not provided, +the default is used which matches the units used in \code{range}. If no +transformation, \code{NULL}.} +} +\description{ +Used in \code{tidyclust::db_clust} model. +} +\examples{ +min_points() +} diff --git a/man/radius.Rd b/man/radius.Rd new file mode 100644 index 00000000..83f2be81 --- /dev/null +++ b/man/radius.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/param_radius.R +\name{radius} +\alias{radius} +\title{Radius used to determine core-points and cluster assignments} +\usage{ +radius(range = c(-2, 2), trans = transform_log10()) +} +\arguments{ +\item{range}{A two-element vector holding the \emph{defaults} for the smallest and +largest possible values, respectively. If a transformation is specified, +these values should be in the \emph{transformed units}.} + +\item{trans}{A \code{trans} object from the \code{scales} package, such as +\code{scales::transform_log10()} or \code{scales::transform_reciprocal()}. If not provided, +the default is used which matches the units used in \code{range}. If no +transformation, \code{NULL}.} +} +\description{ +Used in \code{tidyclust::db_clust}. +} +\examples{ +radius() +} diff --git a/man/shared_shape.Rd b/man/shared_shape.Rd new file mode 100644 index 00000000..31b3f03e --- /dev/null +++ b/man/shared_shape.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/param_shared_shape.R +\name{shared_shape} +\alias{shared_shape} +\title{Parameter to control whether clusters share the same shape in the predictor space +(Only applicable if circular = FALSE)} +\usage{ +shared_shape(values = c(TRUE, FALSE)) +} +\arguments{ +\item{values}{A vector of possible values (TRUE or FALSE).} +} +\description{ +Used in \code{tidyclust::gm_clust()}. +} +\examples{ +shared_shape() +} diff --git a/man/shared_size.Rd b/man/shared_size.Rd new file mode 100644 index 00000000..58f253ed --- /dev/null +++ b/man/shared_size.Rd @@ -0,0 +1,17 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/param_shared_size.R +\name{shared_size} +\alias{shared_size} +\title{Parameter to control whether clusters share the same size in the predictor space} +\usage{ +shared_size(values = c(TRUE, FALSE)) +} +\arguments{ +\item{values}{A vector of possible values (TRUE or FALSE).} +} +\description{ +Used in \code{tidyclust::gm_clust()}. +} +\examples{ +shared_size() +} diff --git a/man/zero_covariance.Rd b/man/zero_covariance.Rd new file mode 100644 index 00000000..97b2971d --- /dev/null +++ b/man/zero_covariance.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/param_shared_orientation.R, +% R/param_zero_covariance.R +\name{zero_covariance} +\alias{zero_covariance} +\title{Parameter to control whether clusters share the same orientation in the predictor space +(Only applicable if zero_covariance = FALSE)} +\usage{ +zero_covariance(values = c(TRUE, FALSE)) + +zero_covariance(values = c(TRUE, FALSE)) +} +\arguments{ +\item{values}{A vector of possible values (TRUE or FALSE).} +} +\description{ +Used in \code{tidyclust::gm_clust()}. + +Used in \code{tidyclust::gm_clust()}. +} +\examples{ +shared_orientation() +zero_covariance() +} From b87eb2d6d69341bc29f3825a89caf574c4e472c4 Mon Sep 17 00:00:00 2001 From: brendad8 <72055001+brendad8@users.noreply.github.com> Date: Wed, 16 Apr 2025 10:46:06 -0700 Subject: [PATCH 2/9] gm and db clust tunable params tested --- NAMESPACE | 1 + R/param_shared_orientation.R | 2 +- man/shared_orientation.Rd | 18 ++++++++++++++++++ man/zero_covariance.Rd | 11 ++--------- tests/testthat/test-params.R | 7 +++++++ 5 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 man/shared_orientation.Rd diff --git a/NAMESPACE b/NAMESPACE index c077e8ed..5915d2a9 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -166,6 +166,7 @@ export(sample_size) export(scale_factor) export(scale_pos_weight) export(select_features) +export(shared_orientation) export(shared_shape) export(shared_size) export(shrinkage_correlation) diff --git a/R/param_shared_orientation.R b/R/param_shared_orientation.R index c2e4d802..f81edab0 100644 --- a/R/param_shared_orientation.R +++ b/R/param_shared_orientation.R @@ -7,7 +7,7 @@ #' @examples #' shared_orientation() #' @export -zero_covariance <- function(values = c(TRUE, FALSE)) { +shared_orientation <- function(values = c(TRUE, FALSE)) { new_qual_param( type = "logical", values = values, diff --git a/man/shared_orientation.Rd b/man/shared_orientation.Rd new file mode 100644 index 00000000..fe31fb76 --- /dev/null +++ b/man/shared_orientation.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/param_shared_orientation.R +\name{shared_orientation} +\alias{shared_orientation} +\title{Parameter to control whether clusters share the same orientation in the predictor space +(Only applicable if zero_covariance = FALSE)} +\usage{ +shared_orientation(values = c(TRUE, FALSE)) +} +\arguments{ +\item{values}{A vector of possible values (TRUE or FALSE).} +} +\description{ +Used in \code{tidyclust::gm_clust()}. +} +\examples{ +shared_orientation() +} diff --git a/man/zero_covariance.Rd b/man/zero_covariance.Rd index 97b2971d..21ec3190 100644 --- a/man/zero_covariance.Rd +++ b/man/zero_covariance.Rd @@ -1,24 +1,17 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/param_shared_orientation.R, -% R/param_zero_covariance.R +% Please edit documentation in R/param_zero_covariance.R \name{zero_covariance} \alias{zero_covariance} -\title{Parameter to control whether clusters share the same orientation in the predictor space -(Only applicable if zero_covariance = FALSE)} +\title{Parameter to control whether clusters have zero covariance between predictors} \usage{ -zero_covariance(values = c(TRUE, FALSE)) - zero_covariance(values = c(TRUE, FALSE)) } \arguments{ \item{values}{A vector of possible values (TRUE or FALSE).} } \description{ -Used in \code{tidyclust::gm_clust()}. - Used in \code{tidyclust::gm_clust()}. } \examples{ -shared_orientation() zero_covariance() } diff --git a/tests/testthat/test-params.R b/tests/testthat/test-params.R index ef309feb..d94a092b 100644 --- a/tests/testthat/test-params.R +++ b/tests/testthat/test-params.R @@ -92,6 +92,8 @@ test_that("param ranges", { expect_equal(num_tokens(c(31,100))$range, list(lower = 31, upper = 100)) expect_equal(mtry_prop(c(.1,.2))$range, list(lower = .1, upper = .2)) expect_equal(dropout(c(.1,.2))$range, list(lower = .1, upper = .2)) + expect_equal(radius(c(0.01, 100))$range, list(lower = 0.01, upper = 100)) + expect_equal(min_points(c(3, 50))$range, list(lower = 3, upper = 50)) }) @@ -120,4 +122,9 @@ test_that("param values", { expect_equal(rate_schedule()$values, values_scheduler) expect_equal(initial_umap()$values, values_initial_umap) expect_equal(all_neighbors(TRUE)$values, TRUE) + expect_equal(circular(TRUE)$values, TRUE) + expect_equal(zero_covariance(TRUE)$values, TRUE) + expect_equal(shared_orientation(TRUE)$values, TRUE) + expect_equal(shared_shape(TRUE)$values, TRUE) + expect_equal(shared_size(TRUE)$values, TRUE) }) From 5a324b0d2daa58c705b6110488a93185dbfc7203 Mon Sep 17 00:00:00 2001 From: brendad8 <72055001+brendad8@users.noreply.github.com> Date: Thu, 19 Jun 2025 16:16:22 -0700 Subject: [PATCH 3/9] documentation --- NAMESPACE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NAMESPACE b/NAMESPACE index 8cb2c4c9..855fb94a 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -53,9 +53,9 @@ export(adjust_deg_free) export(all_neighbors) export(batch_size) export(buffer) -export(circular) export(cal_method_class) export(cal_method_reg) +export(circular) export(class_weights) export(conditional_min_criterion) export(conditional_test_statistic) From b5e22651b01741b32fcc5050659ed184179a9b50 Mon Sep 17 00:00:00 2001 From: brendad8 <72055001+brendad8@users.noreply.github.com> Date: Fri, 27 Jun 2025 19:31:59 -0700 Subject: [PATCH 4/9] link each parameter back to their respective tidyclust specification --- R/param_circular.R | 2 +- R/param_min_points.R | 4 ++-- R/param_radius.R | 2 +- R/param_shared_orientation.R | 2 +- R/param_shared_shape.R | 2 +- R/param_shared_size.R | 2 +- R/param_zero_covariance.R | 2 +- man/circular.Rd | 2 +- man/min_points.Rd | 2 +- man/radius.Rd | 2 +- man/shared_orientation.Rd | 2 +- man/shared_shape.Rd | 2 +- man/shared_size.Rd | 2 +- man/zero_covariance.Rd | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/R/param_circular.R b/R/param_circular.R index bfa9747c..6d6f64d5 100644 --- a/R/param_circular.R +++ b/R/param_circular.R @@ -1,6 +1,6 @@ #' Parameter to control circular or ellipsoidal cluster shapes #' -#' Used in `tidyclust::gm_clust()`. +#' Used in [tidyclust::gm_clust()]. #' #' @param values A vector of possible values (TRUE or FALSE). #' @examples diff --git a/R/param_min_points.R b/R/param_min_points.R index 7c49a737..2a3b9849 100644 --- a/R/param_min_points.R +++ b/R/param_min_points.R @@ -1,6 +1,6 @@ #' Minimum number of nearby points to be considered a core-point #' -#' Used in `tidyclust::db_clust` model. +#' Used in [tidyclust::db_clust()] model. #' #' @inheritParams Laplace #' @examples @@ -12,7 +12,7 @@ min_points <- function(range = c(3L, 50L), trans = NULL) { range = range, inclusive = c(TRUE, TRUE), trans = trans, - label = c(min_points = "Min Points"), + label = c(min_points = "Minimum Points Threshold"), finalize = NULL ) } diff --git a/R/param_radius.R b/R/param_radius.R index 7113d194..255989f7 100644 --- a/R/param_radius.R +++ b/R/param_radius.R @@ -1,6 +1,6 @@ #' Radius used to determine core-points and cluster assignments #' -#' Used in `tidyclust::db_clust`. +#' Used in [tidyclust::db_clust()]. #' #' @inheritParams Laplace #' @examples diff --git a/R/param_shared_orientation.R b/R/param_shared_orientation.R index f81edab0..e9cbe138 100644 --- a/R/param_shared_orientation.R +++ b/R/param_shared_orientation.R @@ -1,7 +1,7 @@ #' Parameter to control whether clusters share the same orientation in the predictor space #' (Only applicable if zero_covariance = FALSE) #' -#' Used in `tidyclust::gm_clust()`. +#' Used in [tidyclust::gm_clust()]. #' #' @param values A vector of possible values (TRUE or FALSE). #' @examples diff --git a/R/param_shared_shape.R b/R/param_shared_shape.R index f003f71e..17b9a8d3 100644 --- a/R/param_shared_shape.R +++ b/R/param_shared_shape.R @@ -1,7 +1,7 @@ #' Parameter to control whether clusters share the same shape in the predictor space #' (Only applicable if circular = FALSE) #' -#' Used in `tidyclust::gm_clust()`. +#' Used in [tidyclust::gm_clust()]. #' #' @param values A vector of possible values (TRUE or FALSE). #' @examples diff --git a/R/param_shared_size.R b/R/param_shared_size.R index e7de7a35..f60e13db 100644 --- a/R/param_shared_size.R +++ b/R/param_shared_size.R @@ -1,6 +1,6 @@ #' Parameter to control whether clusters share the same size in the predictor space #' -#' Used in `tidyclust::gm_clust()`. +#' Used in [tidyclust::gm_clust()]. #' #' @param values A vector of possible values (TRUE or FALSE). #' @examples diff --git a/R/param_zero_covariance.R b/R/param_zero_covariance.R index dae8d993..0a6cb72f 100644 --- a/R/param_zero_covariance.R +++ b/R/param_zero_covariance.R @@ -1,6 +1,6 @@ #' Parameter to control whether clusters have zero covariance between predictors #' -#' Used in `tidyclust::gm_clust()`. +#' Used in [tidyclust::gm_clust()]. #' #' @param values A vector of possible values (TRUE or FALSE). #' @examples diff --git a/man/circular.Rd b/man/circular.Rd index 62a1103d..e7d4fdf7 100644 --- a/man/circular.Rd +++ b/man/circular.Rd @@ -10,7 +10,7 @@ circular(values = c(TRUE, FALSE)) \item{values}{A vector of possible values (TRUE or FALSE).} } \description{ -Used in \code{tidyclust::gm_clust()}. +Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. } \examples{ circular() diff --git a/man/min_points.Rd b/man/min_points.Rd index 078fb6a4..3f9a5d78 100644 --- a/man/min_points.Rd +++ b/man/min_points.Rd @@ -17,7 +17,7 @@ the default is used which matches the units used in \code{range}. If no transformation, \code{NULL}.} } \description{ -Used in \code{tidyclust::db_clust} model. +Used in \code{\link[tidyclust:db_clust]{tidyclust::db_clust()}} model. } \examples{ min_points() diff --git a/man/radius.Rd b/man/radius.Rd index 83f2be81..0ad94a24 100644 --- a/man/radius.Rd +++ b/man/radius.Rd @@ -17,7 +17,7 @@ the default is used which matches the units used in \code{range}. If no transformation, \code{NULL}.} } \description{ -Used in \code{tidyclust::db_clust}. +Used in \code{\link[tidyclust:db_clust]{tidyclust::db_clust()}}. } \examples{ radius() diff --git a/man/shared_orientation.Rd b/man/shared_orientation.Rd index fe31fb76..2fb54a8c 100644 --- a/man/shared_orientation.Rd +++ b/man/shared_orientation.Rd @@ -11,7 +11,7 @@ shared_orientation(values = c(TRUE, FALSE)) \item{values}{A vector of possible values (TRUE or FALSE).} } \description{ -Used in \code{tidyclust::gm_clust()}. +Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. } \examples{ shared_orientation() diff --git a/man/shared_shape.Rd b/man/shared_shape.Rd index 31b3f03e..59625d72 100644 --- a/man/shared_shape.Rd +++ b/man/shared_shape.Rd @@ -11,7 +11,7 @@ shared_shape(values = c(TRUE, FALSE)) \item{values}{A vector of possible values (TRUE or FALSE).} } \description{ -Used in \code{tidyclust::gm_clust()}. +Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. } \examples{ shared_shape() diff --git a/man/shared_size.Rd b/man/shared_size.Rd index 58f253ed..08597695 100644 --- a/man/shared_size.Rd +++ b/man/shared_size.Rd @@ -10,7 +10,7 @@ shared_size(values = c(TRUE, FALSE)) \item{values}{A vector of possible values (TRUE or FALSE).} } \description{ -Used in \code{tidyclust::gm_clust()}. +Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. } \examples{ shared_size() diff --git a/man/zero_covariance.Rd b/man/zero_covariance.Rd index 21ec3190..d9139c25 100644 --- a/man/zero_covariance.Rd +++ b/man/zero_covariance.Rd @@ -10,7 +10,7 @@ zero_covariance(values = c(TRUE, FALSE)) \item{values}{A vector of possible values (TRUE or FALSE).} } \description{ -Used in \code{tidyclust::gm_clust()}. +Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. } \examples{ zero_covariance() From 2a8efd8f5e796fd9d4106aca72f534bc453911e6 Mon Sep 17 00:00:00 2001 From: brendad8 <72055001+brendad8@users.noreply.github.com> Date: Fri, 27 Jun 2025 20:15:08 -0700 Subject: [PATCH 5/9] cross referencing between related arguments for gaussian mixture models --- R/param_circular.R | 4 ++-- R/param_shared_orientation.R | 11 +++++++---- R/param_shared_shape.R | 10 ++++++---- R/param_shared_size.R | 4 ++-- R/param_zero_covariance.R | 9 ++++++--- man/circular.Rd | 4 ++-- man/shared_orientation.Rd | 13 +++++++++---- man/shared_shape.Rd | 12 ++++++++---- man/shared_size.Rd | 4 ++-- man/zero_covariance.Rd | 12 +++++++++--- 10 files changed, 53 insertions(+), 30 deletions(-) diff --git a/R/param_circular.R b/R/param_circular.R index 6d6f64d5..50cb6a5b 100644 --- a/R/param_circular.R +++ b/R/param_circular.R @@ -1,8 +1,8 @@ -#' Parameter to control circular or ellipsoidal cluster shapes +#' Parameter to control whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes #' #' Used in [tidyclust::gm_clust()]. #' -#' @param values A vector of possible values (TRUE or FALSE). +#' @param values A vector of possible values (`TRUE` or `FALSE`). #' @examples #' circular() #' @export diff --git a/R/param_shared_orientation.R b/R/param_shared_orientation.R index e9cbe138..8aa93c2e 100644 --- a/R/param_shared_orientation.R +++ b/R/param_shared_orientation.R @@ -1,11 +1,14 @@ -#' Parameter to control whether clusters share the same orientation in the predictor space -#' (Only applicable if zero_covariance = FALSE) +#' Parameter to control whether whether fitted Gaussian distributions for clusters share the same orientation in the predictor space #' -#' Used in [tidyclust::gm_clust()]. #' -#' @param values A vector of possible values (TRUE or FALSE). +#' Used in [tidyclust::gm_clust()]. Only applicable if `circular == FALSE` and `zero_covariance == FALSE`. +#' +#' @param values A vector of possible values (`TRUE` or `FALSE`). #' @examples #' shared_orientation() +#' @seealso +#' * [circular()] controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes +#' * [zero_covariance()] controls whether fitted Gaussian distributions for clusters have zero covariance between predictors #' @export shared_orientation <- function(values = c(TRUE, FALSE)) { new_qual_param( diff --git a/R/param_shared_shape.R b/R/param_shared_shape.R index 17b9a8d3..72c2750b 100644 --- a/R/param_shared_shape.R +++ b/R/param_shared_shape.R @@ -1,11 +1,13 @@ -#' Parameter to control whether clusters share the same shape in the predictor space -#' (Only applicable if circular = FALSE) +#' Parameter to control whether fitted Gaussian distributions for clusters share the same shape in the predictor space #' -#' Used in [tidyclust::gm_clust()]. #' -#' @param values A vector of possible values (TRUE or FALSE). +#' Used in [tidyclust::gm_clust()]. Only applicable if `circular == FALSE`. +#' +#' @param values A vector of possible values (`TRUE` or `FALSE`). #' @examples #' shared_shape() +#' @seealso +#' * [circular()] controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes #' @export shared_shape <- function(values = c(TRUE, FALSE)) { new_qual_param( diff --git a/R/param_shared_size.R b/R/param_shared_size.R index f60e13db..22f79d7a 100644 --- a/R/param_shared_size.R +++ b/R/param_shared_size.R @@ -1,8 +1,8 @@ -#' Parameter to control whether clusters share the same size in the predictor space +#' Parameter to control whether fitted Gaussian distributions for have clusters share the same size in the predictor space #' #' Used in [tidyclust::gm_clust()]. #' -#' @param values A vector of possible values (TRUE or FALSE). +#' @param values A vector of possible values (`TRUE` or `FALSE`). #' @examples #' shared_size() #' @export diff --git a/R/param_zero_covariance.R b/R/param_zero_covariance.R index 0a6cb72f..7046d383 100644 --- a/R/param_zero_covariance.R +++ b/R/param_zero_covariance.R @@ -1,10 +1,13 @@ -#' Parameter to control whether clusters have zero covariance between predictors +#' Parameter to control whether fitted Gaussian distributions for clusters have zero covariance between predictors #' -#' Used in [tidyclust::gm_clust()]. +#' Used in [tidyclust::gm_clust()]. Only applicable if `ciruclar == FALSE` #' -#' @param values A vector of possible values (TRUE or FALSE). +#' @param values A vector of possible values (`TRUE` or `FALSE`). #' @examples #' zero_covariance() +#' +#' @seealso +#' * [circular()] controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes #' @export zero_covariance <- function(values = c(TRUE, FALSE)) { new_qual_param( diff --git a/man/circular.Rd b/man/circular.Rd index e7d4fdf7..09733930 100644 --- a/man/circular.Rd +++ b/man/circular.Rd @@ -2,12 +2,12 @@ % Please edit documentation in R/param_circular.R \name{circular} \alias{circular} -\title{Parameter to control circular or ellipsoidal cluster shapes} +\title{Parameter to control whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes} \usage{ circular(values = c(TRUE, FALSE)) } \arguments{ -\item{values}{A vector of possible values (TRUE or FALSE).} +\item{values}{A vector of possible values (\code{TRUE} or \code{FALSE}).} } \description{ Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. diff --git a/man/shared_orientation.Rd b/man/shared_orientation.Rd index 2fb54a8c..4989893a 100644 --- a/man/shared_orientation.Rd +++ b/man/shared_orientation.Rd @@ -2,17 +2,22 @@ % Please edit documentation in R/param_shared_orientation.R \name{shared_orientation} \alias{shared_orientation} -\title{Parameter to control whether clusters share the same orientation in the predictor space -(Only applicable if zero_covariance = FALSE)} +\title{Parameter to control whether whether fitted Gaussian distributions for clusters share the same orientation in the predictor space} \usage{ shared_orientation(values = c(TRUE, FALSE)) } \arguments{ -\item{values}{A vector of possible values (TRUE or FALSE).} +\item{values}{A vector of possible values (\code{TRUE} or \code{FALSE}).} } \description{ -Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. +Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. Only applicable if \code{circular == FALSE} and \code{zero_covariance == FALSE}. } \examples{ shared_orientation() } +\seealso{ +\itemize{ +\item \code{\link[=circular]{circular()}} controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes +\item \code{\link[=zero_covariance]{zero_covariance()}} controls whether fitted Gaussian distributions for clusters have zero covariance between predictors +} +} diff --git a/man/shared_shape.Rd b/man/shared_shape.Rd index 59625d72..b6802077 100644 --- a/man/shared_shape.Rd +++ b/man/shared_shape.Rd @@ -2,17 +2,21 @@ % Please edit documentation in R/param_shared_shape.R \name{shared_shape} \alias{shared_shape} -\title{Parameter to control whether clusters share the same shape in the predictor space -(Only applicable if circular = FALSE)} +\title{Parameter to control whether fitted Gaussian distributions for clusters share the same shape in the predictor space} \usage{ shared_shape(values = c(TRUE, FALSE)) } \arguments{ -\item{values}{A vector of possible values (TRUE or FALSE).} +\item{values}{A vector of possible values (\code{TRUE} or \code{FALSE}).} } \description{ -Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. +Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. Only applicable if \code{circular == FALSE}. } \examples{ shared_shape() } +\seealso{ +\itemize{ +\item \code{\link[=circular]{circular()}} controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes +} +} diff --git a/man/shared_size.Rd b/man/shared_size.Rd index 08597695..2b13ea68 100644 --- a/man/shared_size.Rd +++ b/man/shared_size.Rd @@ -2,12 +2,12 @@ % Please edit documentation in R/param_shared_size.R \name{shared_size} \alias{shared_size} -\title{Parameter to control whether clusters share the same size in the predictor space} +\title{Parameter to control whether fitted Gaussian distributions for have clusters share the same size in the predictor space} \usage{ shared_size(values = c(TRUE, FALSE)) } \arguments{ -\item{values}{A vector of possible values (TRUE or FALSE).} +\item{values}{A vector of possible values (\code{TRUE} or \code{FALSE}).} } \description{ Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. diff --git a/man/zero_covariance.Rd b/man/zero_covariance.Rd index d9139c25..9992abc1 100644 --- a/man/zero_covariance.Rd +++ b/man/zero_covariance.Rd @@ -2,16 +2,22 @@ % Please edit documentation in R/param_zero_covariance.R \name{zero_covariance} \alias{zero_covariance} -\title{Parameter to control whether clusters have zero covariance between predictors} +\title{Parameter to control whether fitted Gaussian distributions for clusters have zero covariance between predictors} \usage{ zero_covariance(values = c(TRUE, FALSE)) } \arguments{ -\item{values}{A vector of possible values (TRUE or FALSE).} +\item{values}{A vector of possible values (\code{TRUE} or \code{FALSE}).} } \description{ -Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. +Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. Only applicable if \code{ciruclar == FALSE} } \examples{ zero_covariance() + +} +\seealso{ +\itemize{ +\item \code{\link[=circular]{circular()}} controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes +} } From 807f2e031510837aef56aa93e46175f3f9dc6bfe Mon Sep 17 00:00:00 2001 From: brendad8 <72055001+brendad8@users.noreply.github.com> Date: Fri, 27 Jun 2025 20:33:39 -0700 Subject: [PATCH 6/9] simplify header + create details section --- R/param_circular.R | 4 +++- R/param_shared_orientation.R | 9 +++++---- R/param_shared_shape.R | 9 +++++---- R/param_shared_size.R | 6 ++++-- R/param_zero_covariance.R | 8 +++++--- man/circular.Rd | 5 ++++- man/shared_orientation.Rd | 11 +++++++---- man/shared_shape.Rd | 9 ++++++--- man/shared_size.Rd | 5 ++++- man/zero_covariance.Rd | 9 ++++++--- 10 files changed, 49 insertions(+), 26 deletions(-) diff --git a/R/param_circular.R b/R/param_circular.R index 50cb6a5b..e54fa2d6 100644 --- a/R/param_circular.R +++ b/R/param_circular.R @@ -1,7 +1,9 @@ -#' Parameter to control whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes +#' Circular cluster shapes? #' #' Used in [tidyclust::gm_clust()]. #' +#' @details Parameter to control whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes. +#' #' @param values A vector of possible values (`TRUE` or `FALSE`). #' @examples #' circular() diff --git a/R/param_shared_orientation.R b/R/param_shared_orientation.R index 8aa93c2e..55230bc9 100644 --- a/R/param_shared_orientation.R +++ b/R/param_shared_orientation.R @@ -1,14 +1,15 @@ -#' Parameter to control whether whether fitted Gaussian distributions for clusters share the same orientation in the predictor space +#' Same orientation for all clusters? #' +#' Used in [tidyclust::gm_clust()]. #' -#' Used in [tidyclust::gm_clust()]. Only applicable if `circular == FALSE` and `zero_covariance == FALSE`. +#' @details Parameter to control whether whether fitted Gaussian distributions for clusters share the same orientation in the predictor space. Only applicable if `circular == FALSE` and `zero_covariance == FALSE`. #' #' @param values A vector of possible values (`TRUE` or `FALSE`). #' @examples #' shared_orientation() #' @seealso -#' * [circular()] controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes -#' * [zero_covariance()] controls whether fitted Gaussian distributions for clusters have zero covariance between predictors +#' * [circular()] controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes. +#' * [zero_covariance()] controls whether fitted Gaussian distributions for clusters have zero covariance between predictors. #' @export shared_orientation <- function(values = c(TRUE, FALSE)) { new_qual_param( diff --git a/R/param_shared_shape.R b/R/param_shared_shape.R index 72c2750b..c7ef8b2c 100644 --- a/R/param_shared_shape.R +++ b/R/param_shared_shape.R @@ -1,19 +1,20 @@ -#' Parameter to control whether fitted Gaussian distributions for clusters share the same shape in the predictor space +#' Same shape for all clusters? #' +#' Used in [tidyclust::gm_clust()]. #' -#' Used in [tidyclust::gm_clust()]. Only applicable if `circular == FALSE`. +#' @details Parameter to control whether fitted Gaussian distributions for clusters share the same shape in the predictor space. Only applicable if `circular == FALSE`. #' #' @param values A vector of possible values (`TRUE` or `FALSE`). #' @examples #' shared_shape() #' @seealso -#' * [circular()] controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes +#' * [circular()] controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes. #' @export shared_shape <- function(values = c(TRUE, FALSE)) { new_qual_param( type = "logical", values = values, - label = c(shared_shape = "Shared shape between clusters?"), + label = c(shared_shape = "Same shape for all clusters?"), finalize = NULL ) } diff --git a/R/param_shared_size.R b/R/param_shared_size.R index 22f79d7a..3982777c 100644 --- a/R/param_shared_size.R +++ b/R/param_shared_size.R @@ -1,7 +1,9 @@ -#' Parameter to control whether fitted Gaussian distributions for have clusters share the same size in the predictor space +#' Same size for all clusters? #' #' Used in [tidyclust::gm_clust()]. #' +#' @details Parameter to control whether fitted Gaussian distributions for have clusters share the same size in the predictor space. +#' #' @param values A vector of possible values (`TRUE` or `FALSE`). #' @examples #' shared_size() @@ -10,7 +12,7 @@ shared_size <- function(values = c(TRUE, FALSE)) { new_qual_param( type = "logical", values = values, - label = c(shared_size = "Shared size between clusters?"), + label = c(shared_size = "Same size for all clusters?"), finalize = NULL ) } diff --git a/R/param_zero_covariance.R b/R/param_zero_covariance.R index 7046d383..675b3dc1 100644 --- a/R/param_zero_covariance.R +++ b/R/param_zero_covariance.R @@ -1,13 +1,15 @@ -#' Parameter to control whether fitted Gaussian distributions for clusters have zero covariance between predictors +#' Zero covariance between predictors? #' -#' Used in [tidyclust::gm_clust()]. Only applicable if `ciruclar == FALSE` +#' Used in [tidyclust::gm_clust()]. +#' +#' @details Parameter to control whether fitted Gaussian distributions for clusters have zero covariance between predictors. Only applicable if `ciruclar == FALSE`. #' #' @param values A vector of possible values (`TRUE` or `FALSE`). #' @examples #' zero_covariance() #' #' @seealso -#' * [circular()] controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes +#' * [circular()] controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes. #' @export zero_covariance <- function(values = c(TRUE, FALSE)) { new_qual_param( diff --git a/man/circular.Rd b/man/circular.Rd index 09733930..3f8836d2 100644 --- a/man/circular.Rd +++ b/man/circular.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/param_circular.R \name{circular} \alias{circular} -\title{Parameter to control whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes} +\title{Circular cluster shapes?} \usage{ circular(values = c(TRUE, FALSE)) } @@ -12,6 +12,9 @@ circular(values = c(TRUE, FALSE)) \description{ Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. } +\details{ +Parameter to control whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes. +} \examples{ circular() } diff --git a/man/shared_orientation.Rd b/man/shared_orientation.Rd index 4989893a..01fb19df 100644 --- a/man/shared_orientation.Rd +++ b/man/shared_orientation.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/param_shared_orientation.R \name{shared_orientation} \alias{shared_orientation} -\title{Parameter to control whether whether fitted Gaussian distributions for clusters share the same orientation in the predictor space} +\title{Same orientation for all clusters?} \usage{ shared_orientation(values = c(TRUE, FALSE)) } @@ -10,14 +10,17 @@ shared_orientation(values = c(TRUE, FALSE)) \item{values}{A vector of possible values (\code{TRUE} or \code{FALSE}).} } \description{ -Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. Only applicable if \code{circular == FALSE} and \code{zero_covariance == FALSE}. +Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. +} +\details{ +Parameter to control whether whether fitted Gaussian distributions for clusters share the same orientation in the predictor space. Only applicable if \code{circular == FALSE} and \code{zero_covariance == FALSE}. } \examples{ shared_orientation() } \seealso{ \itemize{ -\item \code{\link[=circular]{circular()}} controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes -\item \code{\link[=zero_covariance]{zero_covariance()}} controls whether fitted Gaussian distributions for clusters have zero covariance between predictors +\item \code{\link[=circular]{circular()}} controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes. +\item \code{\link[=zero_covariance]{zero_covariance()}} controls whether fitted Gaussian distributions for clusters have zero covariance between predictors. } } diff --git a/man/shared_shape.Rd b/man/shared_shape.Rd index b6802077..40eb92d2 100644 --- a/man/shared_shape.Rd +++ b/man/shared_shape.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/param_shared_shape.R \name{shared_shape} \alias{shared_shape} -\title{Parameter to control whether fitted Gaussian distributions for clusters share the same shape in the predictor space} +\title{Same shape for all clusters?} \usage{ shared_shape(values = c(TRUE, FALSE)) } @@ -10,13 +10,16 @@ shared_shape(values = c(TRUE, FALSE)) \item{values}{A vector of possible values (\code{TRUE} or \code{FALSE}).} } \description{ -Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. Only applicable if \code{circular == FALSE}. +Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. +} +\details{ +Parameter to control whether fitted Gaussian distributions for clusters share the same shape in the predictor space. Only applicable if \code{circular == FALSE}. } \examples{ shared_shape() } \seealso{ \itemize{ -\item \code{\link[=circular]{circular()}} controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes +\item \code{\link[=circular]{circular()}} controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes. } } diff --git a/man/shared_size.Rd b/man/shared_size.Rd index 2b13ea68..fab36de1 100644 --- a/man/shared_size.Rd +++ b/man/shared_size.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/param_shared_size.R \name{shared_size} \alias{shared_size} -\title{Parameter to control whether fitted Gaussian distributions for have clusters share the same size in the predictor space} +\title{Same size for all clusters?} \usage{ shared_size(values = c(TRUE, FALSE)) } @@ -12,6 +12,9 @@ shared_size(values = c(TRUE, FALSE)) \description{ Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. } +\details{ +Parameter to control whether fitted Gaussian distributions for have clusters share the same size in the predictor space. +} \examples{ shared_size() } diff --git a/man/zero_covariance.Rd b/man/zero_covariance.Rd index 9992abc1..066c3ae7 100644 --- a/man/zero_covariance.Rd +++ b/man/zero_covariance.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/param_zero_covariance.R \name{zero_covariance} \alias{zero_covariance} -\title{Parameter to control whether fitted Gaussian distributions for clusters have zero covariance between predictors} +\title{Zero covariance between predictors?} \usage{ zero_covariance(values = c(TRUE, FALSE)) } @@ -10,7 +10,10 @@ zero_covariance(values = c(TRUE, FALSE)) \item{values}{A vector of possible values (\code{TRUE} or \code{FALSE}).} } \description{ -Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. Only applicable if \code{ciruclar == FALSE} +Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. +} +\details{ +Parameter to control whether fitted Gaussian distributions for clusters have zero covariance between predictors. Only applicable if \code{ciruclar == FALSE}. } \examples{ zero_covariance() @@ -18,6 +21,6 @@ zero_covariance() } \seealso{ \itemize{ -\item \code{\link[=circular]{circular()}} controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes +\item \code{\link[=circular]{circular()}} controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes. } } From b835a47f49f6232f785e16ba3da70fb5375eec8a Mon Sep 17 00:00:00 2001 From: brendad8 <72055001+brendad8@users.noreply.github.com> Date: Fri, 4 Jul 2025 19:31:57 -0700 Subject: [PATCH 7/9] combine db_clust parameters under dbscan engine file --- R/param_engine_dbscan.R | 40 +++++++++++++++++++++++++ R/param_min_points.R | 18 ----------- R/param_radius.R | 18 ----------- man/{radius.Rd => dbscan_parameters.Rd} | 15 ++++++++-- man/min_points.Rd | 24 --------------- 5 files changed, 52 insertions(+), 63 deletions(-) create mode 100644 R/param_engine_dbscan.R delete mode 100644 R/param_min_points.R delete mode 100644 R/param_radius.R rename man/{radius.Rd => dbscan_parameters.Rd} (58%) delete mode 100644 man/min_points.Rd diff --git a/R/param_engine_dbscan.R b/R/param_engine_dbscan.R new file mode 100644 index 00000000..316aaaf5 --- /dev/null +++ b/R/param_engine_dbscan.R @@ -0,0 +1,40 @@ +#' Parameters for possible engine parameters for dbscan +#' +#' These parameters are used for density-based clustering methods that use the +#' dbscan engine. They correspond to tuning parameters that would be specified using +#' `set_engine("dbscan", ...)`. +#' +#' @inheritParams Laplace +#' @details +#' To use these, check `?tidyclust::db_clust` to see how they are used. +#' - `radius()` controls the radius used to determine core-points and cluster assignments +#' - `min_points()` controls the minimum number of nearby points to be considered a core-point (including the point itself) +#' +#' @examples +#' radius() +#' min_points() +#' @rdname dbscan_parameters +#' @export +radius <- function(range = c(-2, 2), trans = transform_log10()) { + new_quant_param( + type = "double", + range = range, + inclusive = c(TRUE, TRUE), + trans = trans, + label = c(radius = "Radius"), + finalize = NULL + ) +} + +#' @export +#' @rdname dbscan_parameters +min_points <- function(range = c(3L, 50L), trans = NULL) { + new_quant_param( + type = "integer", + range = range, + inclusive = c(TRUE, TRUE), + trans = trans, + label = c(min_points = "Minimum Points Threshold"), + finalize = NULL + ) +} diff --git a/R/param_min_points.R b/R/param_min_points.R deleted file mode 100644 index 2a3b9849..00000000 --- a/R/param_min_points.R +++ /dev/null @@ -1,18 +0,0 @@ -#' Minimum number of nearby points to be considered a core-point -#' -#' Used in [tidyclust::db_clust()] model. -#' -#' @inheritParams Laplace -#' @examples -#' min_points() -#' @export -min_points <- function(range = c(3L, 50L), trans = NULL) { - new_quant_param( - type = "integer", - range = range, - inclusive = c(TRUE, TRUE), - trans = trans, - label = c(min_points = "Minimum Points Threshold"), - finalize = NULL - ) -} diff --git a/R/param_radius.R b/R/param_radius.R deleted file mode 100644 index 255989f7..00000000 --- a/R/param_radius.R +++ /dev/null @@ -1,18 +0,0 @@ -#' Radius used to determine core-points and cluster assignments -#' -#' Used in [tidyclust::db_clust()]. -#' -#' @inheritParams Laplace -#' @examples -#' radius() -#' @export -radius <- function(range = c(-2, 2), trans = transform_log10()) { - new_quant_param( - type = "double", - range = range, - inclusive = c(TRUE, TRUE), - trans = trans, - label = c(radius = "Radius"), - finalize = NULL - ) -} diff --git a/man/radius.Rd b/man/dbscan_parameters.Rd similarity index 58% rename from man/radius.Rd rename to man/dbscan_parameters.Rd index 0ad94a24..adec314a 100644 --- a/man/radius.Rd +++ b/man/dbscan_parameters.Rd @@ -1,10 +1,13 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/param_radius.R +% Please edit documentation in R/param_engine_dbscan.R \name{radius} \alias{radius} -\title{Radius used to determine core-points and cluster assignments} +\alias{min_points} +\title{Parameters for possible engine parameters for dbscan} \usage{ radius(range = c(-2, 2), trans = transform_log10()) + +min_points(range = c(3L, 50L), trans = NULL) } \arguments{ \item{range}{A two-element vector holding the \emph{defaults} for the smallest and @@ -17,8 +20,14 @@ the default is used which matches the units used in \code{range}. If no transformation, \code{NULL}.} } \description{ -Used in \code{\link[tidyclust:db_clust]{tidyclust::db_clust()}}. +These parameters are used for density-based clustering methods that use the +dbscan engine. They correspond to tuning parameters that would be specified using +\code{set_engine("dbscan", ...)}. +} +\details{ +To use these, check \code{?tidyclust::db_clust} to see how they are used. } \examples{ radius() +min_points() } diff --git a/man/min_points.Rd b/man/min_points.Rd deleted file mode 100644 index 3f9a5d78..00000000 --- a/man/min_points.Rd +++ /dev/null @@ -1,24 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/param_min_points.R -\name{min_points} -\alias{min_points} -\title{Minimum number of nearby points to be considered a core-point} -\usage{ -min_points(range = c(3L, 50L), trans = NULL) -} -\arguments{ -\item{range}{A two-element vector holding the \emph{defaults} for the smallest and -largest possible values, respectively. If a transformation is specified, -these values should be in the \emph{transformed units}.} - -\item{trans}{A \code{trans} object from the \code{scales} package, such as -\code{scales::transform_log10()} or \code{scales::transform_reciprocal()}. If not provided, -the default is used which matches the units used in \code{range}. If no -transformation, \code{NULL}.} -} -\description{ -Used in \code{\link[tidyclust:db_clust]{tidyclust::db_clust()}} model. -} -\examples{ -min_points() -} From 766c6ac109248378e40febafe88a59c304bcc8a1 Mon Sep 17 00:00:00 2001 From: brendad8 <72055001+brendad8@users.noreply.github.com> Date: Fri, 4 Jul 2025 19:37:24 -0700 Subject: [PATCH 8/9] update _pkgdown.yml --- _pkgdown.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/_pkgdown.yml b/_pkgdown.yml index 9ab8a7e9..280da31c 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -101,16 +101,23 @@ reference: - title: Parameter objects for specific model engines contents: - bart-param + - circular - conditional_min_criterion - confidence_factor - extrapolation - max_nodes - max_num_terms + - min_points - num_leaves + - radius - regularization_factor - rule_bands - scale_pos_weight + - shared_orientation + - shared_shape + - shared_size - shrinkage_correlation + - zero_covariance - title: Parameter objects for post-processing contents: From dc15fa6970db57ad5d4dae3668bf81cf7e095d51 Mon Sep 17 00:00:00 2001 From: brendad8 <72055001+brendad8@users.noreply.github.com> Date: Fri, 4 Jul 2025 19:51:09 -0700 Subject: [PATCH 9/9] mclust param file created and individual files removed --- R/param_circular.R | 18 --------- R/param_engine_mclust.R | 73 ++++++++++++++++++++++++++++++++++++ R/param_shared_orientation.R | 21 ----------- R/param_shared_shape.R | 20 ---------- R/param_shared_size.R | 18 --------- R/param_zero_covariance.R | 21 ----------- man/circular.Rd | 20 ---------- man/dbscan_parameters.Rd | 4 ++ man/mclust_parameters.Rd | 39 +++++++++++++++++++ man/shared_orientation.Rd | 26 ------------- man/shared_shape.Rd | 25 ------------ man/shared_size.Rd | 20 ---------- man/zero_covariance.Rd | 26 ------------- 13 files changed, 116 insertions(+), 215 deletions(-) delete mode 100644 R/param_circular.R create mode 100644 R/param_engine_mclust.R delete mode 100644 R/param_shared_orientation.R delete mode 100644 R/param_shared_shape.R delete mode 100644 R/param_shared_size.R delete mode 100644 R/param_zero_covariance.R delete mode 100644 man/circular.Rd create mode 100644 man/mclust_parameters.Rd delete mode 100644 man/shared_orientation.Rd delete mode 100644 man/shared_shape.Rd delete mode 100644 man/shared_size.Rd delete mode 100644 man/zero_covariance.Rd diff --git a/R/param_circular.R b/R/param_circular.R deleted file mode 100644 index e54fa2d6..00000000 --- a/R/param_circular.R +++ /dev/null @@ -1,18 +0,0 @@ -#' Circular cluster shapes? -#' -#' Used in [tidyclust::gm_clust()]. -#' -#' @details Parameter to control whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes. -#' -#' @param values A vector of possible values (`TRUE` or `FALSE`). -#' @examples -#' circular() -#' @export -circular <- function(values = c(TRUE, FALSE)) { - new_qual_param( - type = "logical", - values = values, - label = c(circular = "Circular cluster shapes?"), - finalize = NULL - ) -} diff --git a/R/param_engine_mclust.R b/R/param_engine_mclust.R new file mode 100644 index 00000000..c3be5c1a --- /dev/null +++ b/R/param_engine_mclust.R @@ -0,0 +1,73 @@ +#' Parameters for possible engine parameters for mclust +#' +#' These parameters are used for fitting Gaussian mixture models that use the +#' mclust engine. They correspond to tuning parameters that would be specified using +#' `set_engine("mclust", ...)`. +#' +#' @param values For `circular()`, `zero_covariance()`, +#' `shared_orientation()`, `shared_shape()`, and `shared_size()` either `TRUE` or `FALSE`. +#' @details +#' To use these, check `?tidyclust::gm_clust` to see how they are used. +#' @examples +#' circular() +#' zero_covariance() +#' shared_orientation() +#' shared_shape() +#' shared_size() +#' @rdname mclust_parameters +#' @export +circular <- function(values = c(TRUE, FALSE)) { + new_qual_param( + type = "logical", + values = values, + label = c(circular = "Circular cluster shapes?"), + finalize = NULL + ) +} + + +#' @export +#' @rdname mclust_parameters +zero_covariance <- function(values = c(TRUE, FALSE)) { + new_qual_param( + type = "logical", + values = values, + label = c(zero_covariance = "Zero covariance between predictors?"), + finalize = NULL + ) +} + +#' @export +#' @rdname mclust_parameters +shared_orientation <- function(values = c(TRUE, FALSE)) { + new_qual_param( + type = "logical", + values = values, + label = c(shared_orientation = "Shared orientation between clusters?"), + finalize = NULL + ) +} + +#' @export +#' @rdname mclust_parameters +shared_shape <- function(values = c(TRUE, FALSE)) { + new_qual_param( + type = "logical", + values = values, + label = c(shared_shape = "Same shape for all clusters?"), + finalize = NULL + ) +} + + +#' @export +#' @rdname mclust_parameters +shared_size <- function(values = c(TRUE, FALSE)) { + new_qual_param( + type = "logical", + values = values, + label = c(shared_size = "Same size for all clusters?"), + finalize = NULL + ) +} + diff --git a/R/param_shared_orientation.R b/R/param_shared_orientation.R deleted file mode 100644 index 55230bc9..00000000 --- a/R/param_shared_orientation.R +++ /dev/null @@ -1,21 +0,0 @@ -#' Same orientation for all clusters? -#' -#' Used in [tidyclust::gm_clust()]. -#' -#' @details Parameter to control whether whether fitted Gaussian distributions for clusters share the same orientation in the predictor space. Only applicable if `circular == FALSE` and `zero_covariance == FALSE`. -#' -#' @param values A vector of possible values (`TRUE` or `FALSE`). -#' @examples -#' shared_orientation() -#' @seealso -#' * [circular()] controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes. -#' * [zero_covariance()] controls whether fitted Gaussian distributions for clusters have zero covariance between predictors. -#' @export -shared_orientation <- function(values = c(TRUE, FALSE)) { - new_qual_param( - type = "logical", - values = values, - label = c(shared_orientation = "Shared orientation between clusters?"), - finalize = NULL - ) -} diff --git a/R/param_shared_shape.R b/R/param_shared_shape.R deleted file mode 100644 index c7ef8b2c..00000000 --- a/R/param_shared_shape.R +++ /dev/null @@ -1,20 +0,0 @@ -#' Same shape for all clusters? -#' -#' Used in [tidyclust::gm_clust()]. -#' -#' @details Parameter to control whether fitted Gaussian distributions for clusters share the same shape in the predictor space. Only applicable if `circular == FALSE`. -#' -#' @param values A vector of possible values (`TRUE` or `FALSE`). -#' @examples -#' shared_shape() -#' @seealso -#' * [circular()] controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes. -#' @export -shared_shape <- function(values = c(TRUE, FALSE)) { - new_qual_param( - type = "logical", - values = values, - label = c(shared_shape = "Same shape for all clusters?"), - finalize = NULL - ) -} diff --git a/R/param_shared_size.R b/R/param_shared_size.R deleted file mode 100644 index 3982777c..00000000 --- a/R/param_shared_size.R +++ /dev/null @@ -1,18 +0,0 @@ -#' Same size for all clusters? -#' -#' Used in [tidyclust::gm_clust()]. -#' -#' @details Parameter to control whether fitted Gaussian distributions for have clusters share the same size in the predictor space. -#' -#' @param values A vector of possible values (`TRUE` or `FALSE`). -#' @examples -#' shared_size() -#' @export -shared_size <- function(values = c(TRUE, FALSE)) { - new_qual_param( - type = "logical", - values = values, - label = c(shared_size = "Same size for all clusters?"), - finalize = NULL - ) -} diff --git a/R/param_zero_covariance.R b/R/param_zero_covariance.R deleted file mode 100644 index 675b3dc1..00000000 --- a/R/param_zero_covariance.R +++ /dev/null @@ -1,21 +0,0 @@ -#' Zero covariance between predictors? -#' -#' Used in [tidyclust::gm_clust()]. -#' -#' @details Parameter to control whether fitted Gaussian distributions for clusters have zero covariance between predictors. Only applicable if `ciruclar == FALSE`. -#' -#' @param values A vector of possible values (`TRUE` or `FALSE`). -#' @examples -#' zero_covariance() -#' -#' @seealso -#' * [circular()] controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes. -#' @export -zero_covariance <- function(values = c(TRUE, FALSE)) { - new_qual_param( - type = "logical", - values = values, - label = c(zero_covariance = "Zero covariance between predictors?"), - finalize = NULL - ) -} diff --git a/man/circular.Rd b/man/circular.Rd deleted file mode 100644 index 3f8836d2..00000000 --- a/man/circular.Rd +++ /dev/null @@ -1,20 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/param_circular.R -\name{circular} -\alias{circular} -\title{Circular cluster shapes?} -\usage{ -circular(values = c(TRUE, FALSE)) -} -\arguments{ -\item{values}{A vector of possible values (\code{TRUE} or \code{FALSE}).} -} -\description{ -Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. -} -\details{ -Parameter to control whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes. -} -\examples{ -circular() -} diff --git a/man/dbscan_parameters.Rd b/man/dbscan_parameters.Rd index adec314a..d8059707 100644 --- a/man/dbscan_parameters.Rd +++ b/man/dbscan_parameters.Rd @@ -26,6 +26,10 @@ dbscan engine. They correspond to tuning parameters that would be specified usin } \details{ To use these, check \code{?tidyclust::db_clust} to see how they are used. +\itemize{ +\item \code{radius()} controls the radius used to determine core-points and cluster assignments +\item \code{min_points()} controls the minimum number of nearby points to be considered a core-point (including the point itself) +} } \examples{ radius() diff --git a/man/mclust_parameters.Rd b/man/mclust_parameters.Rd new file mode 100644 index 00000000..adae8606 --- /dev/null +++ b/man/mclust_parameters.Rd @@ -0,0 +1,39 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/param_engine_mclust.R +\name{circular} +\alias{circular} +\alias{zero_covariance} +\alias{shared_orientation} +\alias{shared_shape} +\alias{shared_size} +\title{Parameters for possible engine parameters for mclust} +\usage{ +circular(values = c(TRUE, FALSE)) + +zero_covariance(values = c(TRUE, FALSE)) + +shared_orientation(values = c(TRUE, FALSE)) + +shared_shape(values = c(TRUE, FALSE)) + +shared_size(values = c(TRUE, FALSE)) +} +\arguments{ +\item{values}{For \code{circular()}, \code{zero_covariance()}, +\code{shared_orientation()}, \code{shared_shape()}, and \code{shared_size()} either \code{TRUE} or \code{FALSE}.} +} +\description{ +These parameters are used for fitting Gaussian mixture models that use the +mclust engine. They correspond to tuning parameters that would be specified using +\code{set_engine("mclust", ...)}. +} +\details{ +To use these, check \code{?tidyclust::gm_clust} to see how they are used. +} +\examples{ +circular() +zero_covariance() +shared_orientation() +shared_shape() +shared_size() +} diff --git a/man/shared_orientation.Rd b/man/shared_orientation.Rd deleted file mode 100644 index 01fb19df..00000000 --- a/man/shared_orientation.Rd +++ /dev/null @@ -1,26 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/param_shared_orientation.R -\name{shared_orientation} -\alias{shared_orientation} -\title{Same orientation for all clusters?} -\usage{ -shared_orientation(values = c(TRUE, FALSE)) -} -\arguments{ -\item{values}{A vector of possible values (\code{TRUE} or \code{FALSE}).} -} -\description{ -Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. -} -\details{ -Parameter to control whether whether fitted Gaussian distributions for clusters share the same orientation in the predictor space. Only applicable if \code{circular == FALSE} and \code{zero_covariance == FALSE}. -} -\examples{ -shared_orientation() -} -\seealso{ -\itemize{ -\item \code{\link[=circular]{circular()}} controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes. -\item \code{\link[=zero_covariance]{zero_covariance()}} controls whether fitted Gaussian distributions for clusters have zero covariance between predictors. -} -} diff --git a/man/shared_shape.Rd b/man/shared_shape.Rd deleted file mode 100644 index 40eb92d2..00000000 --- a/man/shared_shape.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/param_shared_shape.R -\name{shared_shape} -\alias{shared_shape} -\title{Same shape for all clusters?} -\usage{ -shared_shape(values = c(TRUE, FALSE)) -} -\arguments{ -\item{values}{A vector of possible values (\code{TRUE} or \code{FALSE}).} -} -\description{ -Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. -} -\details{ -Parameter to control whether fitted Gaussian distributions for clusters share the same shape in the predictor space. Only applicable if \code{circular == FALSE}. -} -\examples{ -shared_shape() -} -\seealso{ -\itemize{ -\item \code{\link[=circular]{circular()}} controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes. -} -} diff --git a/man/shared_size.Rd b/man/shared_size.Rd deleted file mode 100644 index fab36de1..00000000 --- a/man/shared_size.Rd +++ /dev/null @@ -1,20 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/param_shared_size.R -\name{shared_size} -\alias{shared_size} -\title{Same size for all clusters?} -\usage{ -shared_size(values = c(TRUE, FALSE)) -} -\arguments{ -\item{values}{A vector of possible values (\code{TRUE} or \code{FALSE}).} -} -\description{ -Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. -} -\details{ -Parameter to control whether fitted Gaussian distributions for have clusters share the same size in the predictor space. -} -\examples{ -shared_size() -} diff --git a/man/zero_covariance.Rd b/man/zero_covariance.Rd deleted file mode 100644 index 066c3ae7..00000000 --- a/man/zero_covariance.Rd +++ /dev/null @@ -1,26 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/param_zero_covariance.R -\name{zero_covariance} -\alias{zero_covariance} -\title{Zero covariance between predictors?} -\usage{ -zero_covariance(values = c(TRUE, FALSE)) -} -\arguments{ -\item{values}{A vector of possible values (\code{TRUE} or \code{FALSE}).} -} -\description{ -Used in \code{\link[tidyclust:gm_clust]{tidyclust::gm_clust()}}. -} -\details{ -Parameter to control whether fitted Gaussian distributions for clusters have zero covariance between predictors. Only applicable if \code{ciruclar == FALSE}. -} -\examples{ -zero_covariance() - -} -\seealso{ -\itemize{ -\item \code{\link[=circular]{circular()}} controls whether fitted Gaussian distributions have circular or ellipsoidal cluster shapes. -} -}