Skip to content

Feature Request: get_best_model_parameters #171

Open

Description

@jkylearmstrong

Wondering if you would be interested in adding something like this:

get_best_model_parameters <- function(workflowset_results, rank_metic){
  best_model <- workflowset_results %>% 
    rank_results(rank_metric = rank_metic, select_best = T) %>% 
    filter(.metric == rank_metic) %>% 
    filter(rank == 1)

  workflowset_results %>%
    filter(wflow_id == best_model$wflow_id) %>%
    select(wflow_id, info) %>%
    tidyr::unnest(info) %>%
    select(wflow_id, preproc, model) %>%
    bind_cols(
      workflowset_results %>%
        extract_workflow_set_result(id = best_model$wflow_id) %>%
        select_best(metric = rank_metic) %>%
        select(-.config)
      )
}

In other words, a way to figure out what the best model hyperparameters are. Although as I think about this, maybe even a more general method for finding model parameters:

get_model_parameters <- function(workflowset_results, rank_metic, select_best =T, rank = 1){
  best_model <- workflowset_results %>% 
    rank_results(rank_metric = rank_metic, select_best = select_best ) %>% 
    filter(.metric == rank_metic) %>% 
    filter(rank == 1)

  workflowset_results %>%
    filter(wflow_id == best_model$wflow_id) %>%
    select(wflow_id, info) %>%
    tidyr::unnest(info) %>%
    select(wflow_id, preproc, model) %>%
    bind_cols(
      workflowset_results %>%
        extract_workflow_set_result(id = best_model$wflow_id) %>%
        select_best(metric = rank_metic) %>%
        select(-.config)
      )
}

Then it defaults to giving the best model parameters, however, the user is able to select other models?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions