Skip to content

Add support for rtemis.server#134

Open
egenn wants to merge 17 commits into
mainfrom
devel
Open

Add support for rtemis.server#134
egenn wants to merge 17 commits into
mainfrom
devel

Conversation

@egenn
Copy link
Copy Markdown
Member

@egenn egenn commented May 27, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 27, 2026 16:00
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a progress callback argument to the train() function to support non-interactive progress tracking, adds a new generic get_varimp for retrieving variable importance, and updates several S7 class definitions and validation helpers. The feedback highlights two key improvements: first, using length(outer_resampler@resamples) instead of outer_resampler@config@n to robustly determine the number of outer folds; second, reverting the use of let() to := in R/draw_box.R to maintain backward compatibility with older versions of data.table since no minimum version is specified in the package description.

Comment thread R/train.R
Comment thread R/draw_box.R Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR appears to improve compatibility with non-interactive callers (notably rtemis.server) by adding an explicit training progress callback, tightening/standardizing S7 class metadata, and introducing a small exported API for variable-importance retrieval.

Changes:

  • Add an optional progress(stage, current, total, message) callback to train() and wire it into the outer resampling loop.
  • Introduce and export a new get_varimp() S7 generic with methods for Supervised / SupervisedRes.
  • Standardize multiple S7 new_class() definitions by setting package = "rtemis" and adjust dependency/check helpers (add rtemis.core).

Reviewed changes

Copilot reviewed 23 out of 25 changed files in this pull request and generated 21 comments.

Show a summary per file
File Description
R/train.R Adds progress callback argument and emits fold-boundary progress events during outer resampling.
R/draw_box.R Attempts to avoid mutating dt before melt() by switching from := to let().
R/decomp.R Header comment tweak.
R/16_S7utils.R Header comment tweak.
R/14_SuperConfig.R Adds package = "rtemis" to S7 classes; modifies roxygen block near class defs.
R/13_Themes.R Adds package = "rtemis" to S7 class; modifies roxygen block near class def.
R/12_Decomposition.R Adds package = "rtemis" to S7 class; modifies roxygen block near class def.
R/11_DecompositionConfig.R Adds package = "rtemis"; swaps numeric checks to rtemis.core::check_numeric().
R/10_Clustering.R Adds package = "rtemis"; modifies roxygen block near class def.
R/09_ClusteringConfig.R Adds package = "rtemis"; swaps numeric checks to rtemis.core::check_numeric().
R/08_MassUni.R Adds package = "rtemis" and adjusts class documentation tags.
R/07_Supervised.R Adds package = "rtemis" to several classes and adds get_varimp methods.
R/06_Tuner.R Adds package = "rtemis"; modifies roxygen block near class defs.
R/05_Resampler.R Adds package = "rtemis"; modifies roxygen block near class defs.
R/04_Preprocessor.R Adds package = "rtemis"; modifies roxygen block near class defs.
R/03_Metrics.R Adds package = "rtemis"; modifies roxygen block near class def.
R/02_Hyperparameters.R Adds package = "rtemis"; swaps numeric checks to rtemis.core::check_numeric().
R/01_ExecutionConfig.R Adds package = "rtemis"; modifies roxygen block near class def.
R/00_S7init.R Defines/export get_varimp S7 generic and roxygen docs/examples.
NAMESPACE Exports get_varimp.
man/train.Rd Documents new progress argument.
man/get_varimp.Rd Adds generated documentation for get_varimp.
Makefile Changes log timestamp formatting.
DESCRIPTION Bumps version/date; adds rtemis.core to Imports; removes plumber from Suggests.
.Rbuildignore Removes one ignore entry; adds ignore pattern for PDFs.
Files not reviewed (2)
  • man/get_varimp.Rd: Language not supported
  • man/train.Rd: Language not supported
Comments suppressed due to low confidence (1)

R/draw_box.R:972

  • dt[, let(ID = .I)] does not preserve the existing columns of dt, so data.table::melt() will likely fail because id.vars includes columns like timeperiod/group/hovertext that are no longer present. To avoid mutating dt while keeping all columns, use something like copy(dt)[, ID := .I] (or add ID then remove it after melting).
    # appease R CMD check ?rm timeperiod <- NULL
    ID <- timeperiod <- NULL
    dtlong <- data.table::melt(
      dt[, let(ID = .I)],
      id.vars = c(
        "ID",
        "timeperiod",
        mgetnames(dt, "group", "hovertext")
      )
    )

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread R/01_ExecutionConfig.R Outdated
Comment thread R/02_Hyperparameters.R Outdated
Comment thread R/03_Metrics.R
Comment thread R/04_Preprocessor.R Outdated
Comment thread R/05_Resampler.R Outdated
Comment thread R/04_Preprocessor.R
Comment thread R/05_Resampler.R
Comment thread R/06_Tuner.R
Comment thread R/draw_box.R Outdated
Comment thread R/00_S7init.R Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants