Skip to content

0 to 1 probability scale #1

@hickman-santini

Description

@hickman-santini

It would be really nice to be able to use this library without first converting all probability vectors to 0 to 100 scale. Suggest adding a global option for this:

# Function to set the global option
set_probability_scale <- function(scale_0_1 = FALSE) {
  options(use_prob_scale_0_1 = scale_0_1)
}

Then modify each of the agg functions:

your_function <- function(prob_vector) {
  if (getOption("use_prob_scale_0_1")) {
    prob_vector <- prob_vector * 100
  }
  # ... rest of your function ...
}

I think we'd also need to add an .onLoad function to set the option to FALSE by default (so this doesn't break XPT code).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions