Skip to content

Add CRAN-compliant example to set_hyperparameters documentation#50

Merged
osorensen merged 2 commits intomainfrom
copilot/update-set-hyperparameters-docs
Jan 21, 2026
Merged

Add CRAN-compliant example to set_hyperparameters documentation#50
osorensen merged 2 commits intomainfrom
copilot/update-set-hyperparameters-docs

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 21, 2026

The set_hyperparameters function lacked documentation examples and had minimal parameter descriptions, making it difficult for users to understand how to configure priors for the Bayesian Mallows model.

Changes

  • Enhanced parameter documentation: Expanded descriptions for alpha_shape, alpha_rate, and cluster_concentration to clarify their statistical meaning and when they're used
  • Improved return value: Documented all list components returned by the function
  • Added runnable example: Demonstrates setting custom hyperparameters and using them with compute_sequentially on the partial_rankings dataset
  • CRAN-optimized parameters: Example uses 20 particles and 4 particle filters for fast execution during package checks

Example

# Set custom prior for alpha parameter
hyperparams <- set_hyperparameters(
  n_items = 5, 
  alpha_shape = 2,  # Higher shape increases prior mean
  alpha_rate = 1
)

# Use with compute_sequentially
mod <- compute_sequentially(
  partial_rankings,
  hyperparameters = hyperparams,
  smc_options = set_smc_options(
    n_particles = 20, 
    n_particle_filters = 4
  )
)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cloud.r-project.org
    • Triggering command: /usr/lib/R/bin/exec/R /usr/lib/R/bin/exec/R --no-echo --no-restore -e dir.create(Sys.getenv(&#39;R_LIBS_USER&#39;),~&#43;~recursive=TRUE);~&#43;~.libPaths(c(Sys.getenv(&#39;R_LIBS_USER&#39;),~&#43;~.libPaths()));~&#43;~install.packages(&#39;roxygen2&#39;,~&#43;~repos=&#39;REDACTED&#39;,~&#43;~lib=Sys.getenv(&#39;R_LIBS_USER&#39;)) (dns block)
    • Triggering command: /usr/lib/R/bin/exec/R /usr/lib/R/bin/exec/R --vanilla --quiet (dns block)
  • cran.r-project.org
    • Triggering command: /usr/lib/R/bin/exec/R /usr/lib/R/bin/exec/R --vanilla --quiet (dns block)
  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Document set_hyperparameters</issue_title>
<issue_description>Update the documentation to set_hyperparameters so that it is CRAN compliant. Create an example using the included partial_rankings dataset which also shows how compute_sequentially can be used with different hyperparameters. Make it simple and short so that it runs in the time required on CRAN. For example 20 particles and 4 particle filters would be fine.</issue_description>

<agent_instructions>Make sure the example runs</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: osorensen <21175639+osorensen@users.noreply.github.com>
Copilot AI changed the title [WIP] Update documentation for set_hyperparameters to ensure CRAN compliance Add CRAN-compliant example to set_hyperparameters documentation Jan 21, 2026
Copilot AI requested a review from osorensen January 21, 2026 10:34
@osorensen osorensen marked this pull request as ready for review January 21, 2026 10:38
@osorensen osorensen merged commit 7ef1820 into main Jan 21, 2026
5 checks passed
@osorensen osorensen deleted the copilot/update-set-hyperparameters-docs branch January 21, 2026 10:44
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.

Document set_hyperparameters

2 participants