Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Generated by roxygen2: do not edit by hand

S3method(augment,orbital_class)
S3method(estimate_adj_chars,default)
S3method(estimate_adj_chars,equivocal_zone)
S3method(estimate_adj_chars,numeric_range)
S3method(estimate_adj_chars,predictions_custom)
S3method(estimate_adj_chars,probability_threshold)
S3method(estimate_orbital_size,catboost.Model)
S3method(estimate_orbital_size,constparty)
S3method(estimate_orbital_size,default)
Expand All @@ -16,6 +21,35 @@ S3method(estimate_orbital_size,rpart)
S3method(estimate_orbital_size,tailor)
S3method(estimate_orbital_size,workflow)
S3method(estimate_orbital_size,xgb.Booster)
S3method(estimate_step_chars,default)
S3method(estimate_step_chars,step_adasyn)
S3method(estimate_step_chars,step_bsmote)
S3method(estimate_step_chars,step_center)
S3method(estimate_step_chars,step_corr)
S3method(estimate_step_chars,step_downsample)
S3method(estimate_step_chars,step_dummy)
S3method(estimate_step_chars,step_filter_missing)
S3method(estimate_step_chars,step_impute_mean)
S3method(estimate_step_chars,step_impute_median)
S3method(estimate_step_chars,step_indicate_na)
S3method(estimate_step_chars,step_lincomb)
S3method(estimate_step_chars,step_log)
S3method(estimate_step_chars,step_mutate)
S3method(estimate_step_chars,step_nearmiss)
S3method(estimate_step_chars,step_normalize)
S3method(estimate_step_chars,step_nzv)
S3method(estimate_step_chars,step_pca)
S3method(estimate_step_chars,step_range)
S3method(estimate_step_chars,step_rm)
S3method(estimate_step_chars,step_rose)
S3method(estimate_step_chars,step_scale)
S3method(estimate_step_chars,step_select)
S3method(estimate_step_chars,step_smote)
S3method(estimate_step_chars,step_smotenc)
S3method(estimate_step_chars,step_sqrt)
S3method(estimate_step_chars,step_tomek)
S3method(estimate_step_chars,step_upsample)
S3method(estimate_step_chars,step_zv)
S3method(orbital,catboost.Model)
S3method(orbital,constparty)
S3method(orbital,default)
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# orbital (development version)

## Improvements

* `estimate_orbital_size()` is a new function that quickly estimates the character count of the orbital expression for a model without generating it. (#144)

## Bug fixes

* `step_dummy()` and `step_indicate_na()` now generate SQL compatible with Snowflake and other databases that don't support casting booleans directly to numeric types. (#145)

# orbital 0.5.0
Expand Down
1 change: 1 addition & 0 deletions R/adjust_equivocal_zone.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ orbital.equivocal_zone <- function(x, tailor, type, prefix, ...) {
}

# dplyr::case_when with 3 branches and arithmetic ~= 120 chars
#' @exportS3Method
estimate_adj_chars.equivocal_zone <- function(x, ...) {
120L
}
1 change: 1 addition & 0 deletions R/adjust_numeric_range.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ orbital.numeric_range <- function(x, tailor, ...) {
}

# dplyr::case_when with 2-3 branches ~= 80 chars
#' @exportS3Method
estimate_adj_chars.numeric_range <- function(x, ...) {
lower <- x$arguments$lower_limit
upper <- x$arguments$upper_limit
Expand Down
1 change: 1 addition & 0 deletions R/adjust_predictions_custom.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ orbital.predictions_custom <- function(x, ...) {
}

# Estimate based on number of expressions, ~50 chars each
#' @exportS3Method
estimate_adj_chars.predictions_custom <- function(x, ...) {
n_exprs <- length(x$arguments$commands)
if (n_exprs == 0) {
Expand Down
1 change: 1 addition & 0 deletions R/adjust_probability_threshold.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ orbital.probability_threshold <- function(x, tailor, type, prefix, ...) {
}

# dplyr::case_when with 3 branches ~= 100 chars
#' @exportS3Method
estimate_adj_chars.probability_threshold <- function(x, ...) {
100L
}
2 changes: 2 additions & 0 deletions R/estimate-size.R
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ estimate_step_chars <- function(x, ...) {

# Default: estimate based on number of columns affected
# Most steps produce ~40 chars per column as a rough baseline
#' @exportS3Method
estimate_step_chars.default <- function(x, ...) {
n_cols <- length(x$columns %||% 0L)
as.integer(n_cols * 40)
Expand All @@ -433,6 +434,7 @@ estimate_adj_chars <- function(x, ...) {
}

# Default: most adjustments produce ~80 chars for a case_when expression
#' @exportS3Method
estimate_adj_chars.default <- function(x, ...) {
80L
}
1 change: 1 addition & 0 deletions R/step_adasyn.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ orbital.step_adasyn <- function(x, all_vars, ...) {
)
}

#' @exportS3Method
estimate_step_chars.step_adasyn <- function(x, ...) {
0L
}
1 change: 1 addition & 0 deletions R/step_bsmote.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ orbital.step_bsmote <- function(x, all_vars, ...) {
)
}

#' @exportS3Method
estimate_step_chars.step_bsmote <- function(x, ...) {
0L
}
1 change: 1 addition & 0 deletions R/step_center.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ orbital.step_center <- function(x, all_vars, ...) {
out
}

#' @exportS3Method
estimate_step_chars.step_center <- function(x, ...) {
n_cols <- length(x$means)
if (n_cols == 0) {
Expand Down
1 change: 1 addition & 0 deletions R/step_corr.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ orbital.step_corr <- function(x, all_vars, ...) {
NULL
}

#' @exportS3Method
estimate_step_chars.step_corr <- function(x, ...) {
0L
}
1 change: 1 addition & 0 deletions R/step_downsample.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ orbital.step_downsample <- function(x, all_vars, ...) {
)
}

#' @exportS3Method
estimate_step_chars.step_downsample <- function(x, ...) {
0L
}
1 change: 1 addition & 0 deletions R/step_dummy.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ orbital.step_dummy <- function(x, all_vars, ...) {
out
}

#' @exportS3Method
estimate_step_chars.step_dummy <- function(x, ...) {
total <- 0L
for (var in names(x$levels)) {
Expand Down
1 change: 1 addition & 0 deletions R/step_filter_missing.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ orbital.step_filter_missing <- function(x, all_vars, ...) {
NULL
}

#' @exportS3Method
estimate_step_chars.step_filter_missing <- function(x, ...) {
0L
}
1 change: 1 addition & 0 deletions R/step_impute_mean.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ orbital.step_impute_mean <- function(x, all_vars, ...) {
out
}

#' @exportS3Method
estimate_step_chars.step_impute_mean <- function(x, ...) {
n_cols <- length(x$means)
if (n_cols == 0) {
Expand Down
1 change: 1 addition & 0 deletions R/step_impute_median.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ orbital.step_impute_median <- function(x, all_vars, ...) {
out
}

#' @exportS3Method
estimate_step_chars.step_impute_median <- function(x, ...) {
n_cols <- length(x$medians)
if (n_cols == 0) {
Expand Down
1 change: 1 addition & 0 deletions R/step_indicate_na.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ orbital.step_indicate_na <- function(x, all_vars, ...) {
out
}

#' @exportS3Method
estimate_step_chars.step_indicate_na <- function(x, ...) {
n_cols <- length(x$columns)
if (n_cols == 0) {
Expand Down
1 change: 1 addition & 0 deletions R/step_lincomb.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ orbital.step_lincomb <- function(x, all_vars, ...) {
NULL
}

#' @exportS3Method
estimate_step_chars.step_lincomb <- function(x, ...) {
0L
}
1 change: 1 addition & 0 deletions R/step_log.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ orbital.step_log <- function(x, all_vars, ...) {
out
}

#' @exportS3Method
estimate_step_chars.step_log <- function(x, ...) {
n_cols <- length(x$columns)
if (n_cols == 0) {
Expand Down
1 change: 1 addition & 0 deletions R/step_mutate.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ orbital.step_mutate <- function(x, all_vars, ...) {
out
}

#' @exportS3Method
estimate_step_chars.step_mutate <- function(x, ...) {
n_exprs <- length(x$inputs)
as.integer(n_exprs * 50)
Expand Down
1 change: 1 addition & 0 deletions R/step_nearmiss.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ orbital.step_nearmiss <- function(x, all_vars, ...) {
)
}

#' @exportS3Method
estimate_step_chars.step_nearmiss <- function(x, ...) {
0L
}
1 change: 1 addition & 0 deletions R/step_normalize.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ orbital.step_normalize <- function(x, all_vars, ...) {
out
}

#' @exportS3Method
estimate_step_chars.step_normalize <- function(x, ...) {
n_cols <- length(x$means)
if (n_cols == 0) {
Expand Down
1 change: 1 addition & 0 deletions R/step_nzv.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ orbital.step_nzv <- function(x, all_vars, ...) {
NULL
}

#' @exportS3Method
estimate_step_chars.step_nzv <- function(x, ...) {
0L
}
1 change: 1 addition & 0 deletions R/step_pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ orbital.step_pca <- function(x, all_vars, ...) {
out
}

#' @exportS3Method
estimate_step_chars.step_pca <- function(x, ...) {
rot <- x$res$rotation
n_components <- ncol(rot)
Expand Down
1 change: 1 addition & 0 deletions R/step_range.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ orbital.step_range <- function(x, all_vars, ...) {
out
}

#' @exportS3Method
estimate_step_chars.step_range <- function(x, ...) {
n_cols <- ncol(x$ranges)
if (n_cols == 0) {
Expand Down
1 change: 1 addition & 0 deletions R/step_rm.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ orbital.step_rm <- function(x, all_vars, ...) {
NULL
}

#' @exportS3Method
estimate_step_chars.step_rm <- function(x, ...) {
0L
}
1 change: 1 addition & 0 deletions R/step_rose.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ orbital.step_rose <- function(x, all_vars, ...) {
)
}

#' @exportS3Method
estimate_step_chars.step_rose <- function(x, ...) {
0L
}
1 change: 1 addition & 0 deletions R/step_scale.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ orbital.step_scale <- function(x, all_vars, ...) {
out
}

#' @exportS3Method
estimate_step_chars.step_scale <- function(x, ...) {
n_cols <- length(x$sds)
if (n_cols == 0) {
Expand Down
1 change: 1 addition & 0 deletions R/step_select.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ orbital.step_select <- function(x, all_vars, ...) {
NULL
}

#' @exportS3Method
estimate_step_chars.step_select <- function(x, ...) {
0L
}
1 change: 1 addition & 0 deletions R/step_smote.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ orbital.step_smote <- function(x, all_vars, ...) {
)
}

#' @exportS3Method
estimate_step_chars.step_smote <- function(x, ...) {
0L
}
1 change: 1 addition & 0 deletions R/step_smotenc.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ orbital.step_smotenc <- function(x, all_vars, ...) {
)
}

#' @exportS3Method
estimate_step_chars.step_smotenc <- function(x, ...) {
0L
}
1 change: 1 addition & 0 deletions R/step_sqrt.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ orbital.step_sqrt <- function(x, all_vars, ...) {
out
}

#' @exportS3Method
estimate_step_chars.step_sqrt <- function(x, ...) {
n_cols <- length(x$columns)
if (n_cols == 0) {
Expand Down
1 change: 1 addition & 0 deletions R/step_tomek.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ orbital.step_tomek <- function(x, all_vars, ...) {
)
}

#' @exportS3Method
estimate_step_chars.step_tomek <- function(x, ...) {
0L
}
1 change: 1 addition & 0 deletions R/step_upsample.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ orbital.step_upsample <- function(x, all_vars, ...) {
)
}

#' @exportS3Method
estimate_step_chars.step_upsample <- function(x, ...) {
0L
}
1 change: 1 addition & 0 deletions R/step_zv.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ orbital.step_zv <- function(x, all_vars, ...) {
NULL
}

#' @exportS3Method
estimate_step_chars.step_zv <- function(x, ...) {
0L
}
Loading