Skip to content

Commit b69daa9

Browse files
authored
Merge pull request #102 from rtemis-org/develop
Develop
2 parents 77ab2ce + 5da5e29 commit b69daa9

30 files changed

+154
-116
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: rtemis
2-
Version: 0.99.1000
2+
Version: 0.99.1005
33
Title: Advanced Machine Learning and Visualization
4-
Date: 2025-10-18
4+
Date: 2025-11-25
55
Authors@R: person(given = "E.D.", family = "Gennatas", role = c("aut", "cre"), email = "gennatas@gmail.com", comment = c(ORCID = "0000-0001-9280-3609"))
66
Description: Advanced Machine Learning and Visualization for all.
77
License: GPL (>= 3)

NAMESPACE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ export(plot_true_pred.Regression)
138138
export(plot_true_pred.RegressionRes)
139139
export(plot_varimp)
140140
export(preprocess)
141+
export(preprocessed)
141142
export(present)
142143
export(present.list)
143144
export(previewcolor)
@@ -149,6 +150,7 @@ export(recycle)
149150
export(regression_metrics)
150151
export(repr)
151152
export(repr_S7name)
153+
export(repr_ls)
152154
export(resample)
153155
export(rnormmat)
154156
export(rt_reactable)
@@ -187,7 +189,6 @@ export(setup_TabNet)
187189
export(setup_UMAP)
188190
export(setup_tSNE)
189191
export(sge_submit)
190-
export(show_ls)
191192
export(size)
192193
export(sparsernorm)
193194
export(summarize)

R/00_S7_init.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# References
66
# S7 generics: https://rconsortium.github.io/S7/articles/generics-methods.html
77

8+
# --- Generics -------------------------------------------------------------------------------------
9+
810
#' String representation
911
#'
1012
#' @details
@@ -366,3 +368,14 @@ get_output_type <- function(
366368

367369
match.arg(output_type)
368370
} # /rtemis::get_output_type
371+
372+
373+
#' Get preprocessed data from Preprocessor
374+
#'
375+
#' @param x Preprocessor: A Preprocessor object.
376+
#' @param ... Not used.
377+
#'
378+
#' @return data.frame: The preprocessed data.
379+
#'
380+
#' @export
381+
preprocessed <- new_generic("preprocessed", "x")

R/01_S7_Hyperparameters.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ TUNED_STATUS_TUNED <- 1L
2323

2424
# `resampled` values ----
2525
# 0: Running on single training set.
26-
# 1: Running on cross-validated training sets.
26+
# 1: Running on resampled training sets.
2727

2828
#' @title Hyperparameters
2929
#'
@@ -32,10 +32,11 @@ TUNED_STATUS_TUNED <- 1L
3232
#'
3333
#' @field algorithm Character: Algorithm name.
3434
#' @field hyperparameters Named list of algorithm hyperparameter values.
35-
#' @field tuned Integer: Tuning status.
36-
#' @field resampled Integer: Cross-validation status.
3735
#' @field tunable_hyperparameters Character: Names of tunable hyperparameters.
3836
#' @field fixed_hyperparameters Character: Names of fixed hyperparameters.
37+
#' @field tuned Integer: Tuning status.
38+
#' @field resampled Integer: Outer resampling status.
39+
#' @field n_workers Integer: Number of workers to use for tuning.
3940
#'
4041
#' @author EDG
4142
#' @noRd
@@ -140,7 +141,7 @@ method(repr, Hyperparameters) <- function(
140141
)
141142
out <- paste0(
142143
out,
143-
show_ls(
144+
repr_ls(
144145
props(x)[-1],
145146
pad = pad,
146147
maxlength = maxlength,

R/02_S7_Metrics.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ method(repr, RegressionMetrics) <- function(
8787
}
8888
out <- paste0(
8989
out,
90-
show_ls(
90+
repr_ls(
9191
x@metrics,
9292
print_class = FALSE,
9393
print_df = TRUE,
@@ -296,7 +296,7 @@ method(repr, MetricsRes) <- function(
296296
names(metricsl) <- names(x@mean_metrics)
297297
out <- paste0(
298298
out,
299-
show_ls(
299+
repr_ls(
300300
metricsl,
301301
print_class = FALSE,
302302
print_df = TRUE,

R/03_S7_Preprocessor.R

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ method(repr, PreprocessorConfig) <- function(
9090
output_type <- get_output_type(output_type)
9191
paste0(
9292
repr_S7name("PreprocessorConfig", pad = pad, output_type = output_type),
93-
show_ls(props(x), pad = pad, limit = limit, output_type = output_type)
93+
repr_ls(props(x), pad = pad, limit = limit, output_type = output_type)
9494
)
9595
} # /rtemis::show.PreprocessorConfig
9696

@@ -350,7 +350,7 @@ method(repr, Preprocessor) <- function(
350350
output_type <- get_output_type(output_type)
351351
out <- paste0(
352352
repr_S7name("Preprocessor", pad = pad, output_type = output_type),
353-
show_ls(props(x), pad = pad, print_df = print_df)
353+
repr_ls(props(x), pad = pad, print_df = print_df)
354354
)
355355
} # /rtemis::show.Preprocessor
356356

@@ -385,3 +385,8 @@ method(`[`, Preprocessor) <- function(x, name) {
385385
method(`[[`, Preprocessor) <- function(x, name) {
386386
props(x)[[name]]
387387
}
388+
389+
# preprocessed.Preprocessor ----
390+
method(preprocessed, Preprocessor) <- function(x) {
391+
x@preprocessed
392+
}

R/05_S7_Tuner.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ method(repr, GridSearch) <- function(
340340
)
341341
out <- paste(
342342
out,
343-
show_ls(x@best_hyperparameters, output_type = output_type),
343+
repr_ls(x@best_hyperparameters, output_type = output_type),
344344
sep = ""
345345
)
346346
out

R/06_S7_Supervised.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# ::rtemis::
33
# 2025 EDG rtemis.org
44

5-
# Refs & Res
5+
# References
66
# https://github.com/RConsortium/S7/
77
# https://rconsortium.github.io/S7
88
# https://rconsortium.github.io/S7/articles/classes-objects.html?q=computed#computed-properties
@@ -412,6 +412,7 @@ get_explain_fn <- function(algorithm) {
412412
paste0("explain_", algorithm)
413413
}
414414

415+
415416
# Explain Supervised ----
416417
#' Explain Supervised
417418
#'

R/08_S7_ClusteringConfig.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ method(repr, ClusteringConfig) <- function(
5353
)
5454
paste0(
5555
out,
56-
show_ls(props(x)[["config"]], pad = pad, output_type = output_type)
56+
repr_ls(props(x)[["config"]], pad = pad, output_type = output_type)
5757
)
5858
} # /show
5959

R/09_S7_Clustering.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ method(repr, Clustering) <- function(
5757
output_type <- get_output_type(output_type)
5858
paste0(
5959
repr_S7name(paste(x$algorithm, "Clustering")),
60-
show_ls(props(x)[-1], pad = pad, output_type = output_type)
60+
repr_ls(props(x)[-1], pad = pad, output_type = output_type)
6161
)
6262
} # /rtemis::show.Clustering
6363

0 commit comments

Comments
 (0)