Skip to content

First PR for Model Parameters Pipeline#1

Open
martinwellman wants to merge 124 commits intomainfrom
first
Open

First PR for Model Parameters Pipeline#1
martinwellman wants to merge 124 commits intomainfrom
first

Conversation

@martinwellman
Copy link
Copy Markdown
Collaborator

This PR includes all functionality for performing the following Model Parameters steps:

  • center
  • dummy
  • interaction
  • logistic
  • rcs

These are all the steps required by HTNPoRT. Support for additional steps (such as fine-and-gray) can be added in the future. The documentation also includes detailed instructions on how to add support for additional steps (see ADDING_NEW_STEP.md) as well as how to add unit tests for any new steps (see tests/testthat/testdata/step-tests/README.md).

There are unit tests for the utility functions (R/model_parameters_pipeline_utils.R) and for the actual pipeline itself (R/model_parameters_pipeline.R) including all transformation steps. There is also a test that uses all HTNPoRT Model Parameters transformation steps and validation data. The data is passed through the pipeline and compared with the expected predicted risks.

@yulric
Copy link
Copy Markdown
Collaborator

yulric commented Feb 4, 2026

@martinwellman I was using the code on another project and realized that I missed a mistake. The logistic step should be called logistic-regression and not logistic

@martinwellman martinwellman removed the request for review from yulric February 12, 2026 17:43
…sion' transformation step (to match the actual step name)
@martinwellman martinwellman requested review from DougManuel, rafdoodle and yulric and removed request for DougManuel and rafdoodle April 28, 2026 16:15
Copy link
Copy Markdown
Collaborator

@yulric yulric left a comment

Choose a reason for hiding this comment

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

Looks good! Minor comment that there are spots where stop is called without a custom error being created with .make_error. Is that intentional?

Reminder that this will eventually be moved to the model-parameters package and should use the validate_model_parameter_file function.

Also, did not know about the .make_error standard! Really cool!

Comment on lines +233 to +242
#' \item \code{inaccessible_file}: Raised if a step specification file does
#' not exist or, if `mod$sandbox_path` is set, is not a descendant of that
#' directory.
#' \item \code{invalid_file_format}: Raised if a step specification file
#' cannot be parsed as a CSV.
#' \item \code{missing_columns}: Raised when a step specification file is
#' missing required columns.
#' \item \code{file_not_added}: Raised indirectly via the step functions if
#' a file was not successfully added to the model cache; should not occur
#' in normal use.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does the run_model_pipeline actually raise any of these errors? I would assume they're only raised by the prepare_model_pipeline function?

@martinwellman martinwellman requested review from DougManuel and rafdoodle and removed request for DougManuel and rafdoodle May 4, 2026 16:45
@martinwellman martinwellman requested a review from yulric May 4, 2026 17:03
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