Skip to content

Commit d34f0c7

Browse files
committed
fix issue when using model selection/grouping in model selection
1 parent 9df5b0b commit d34f0c7

1 file changed

Lines changed: 21 additions & 13 deletions

File tree

R-pkg/R/81_random_forest_submodule.R

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,17 @@ rf_parameter_ui <- function(id) {
210210
ns("possible_parameters")
211211
)
212212
),
213+
conditionalPanel(
214+
condition = "input.run_mode == 'model_choice'", ns = ns,
215+
textInput(
216+
ns("group"),
217+
label = "Scenario grouping and selection"
218+
) %>%
219+
helper(type = "markdown",
220+
content = "scenario_grouping_selection"),
221+
uiOutput(ns("help_group")),
222+
uiOutput(ns("feedback_group"))
223+
),
213224
numericInput(
214225
ns("n_rec"),
215226
label = "Number of samples in the training set to consider",
@@ -259,17 +270,6 @@ rf_parameter_ui <- function(id) {
259270
helper(type = "markdown",
260271
content = "noob_parameter")
261272
),
262-
conditionalPanel(
263-
condition = "input.run_mode == 'model_choice'", ns = ns,
264-
textInput(
265-
ns("group"),
266-
label = "Scenario grouping and selection"
267-
) %>%
268-
helper(type = "markdown",
269-
content = "scenario_grouping_selection"),
270-
uiOutput(ns("help_group")),
271-
uiOutput(ns("feedback_group"))
272-
),
273273
numericInput(
274274
ns("n_tree"),
275275
label = "Number of trees",
@@ -682,7 +682,7 @@ rf_parameter_server <- function(input, output, session,
682682
})
683683

684684
# check and feedback groups
685-
observe({
685+
observeEvent(input$group, {
686686
req(input$group)
687687
req(local$proj_header_content)
688688

@@ -695,7 +695,7 @@ rf_parameter_server <- function(input, output, session,
695695
)
696696

697697
# save check
698-
local$param_ready <- local$param_ready & group_check$valid
698+
local$param_ready <- group_check$valid
699699

700700
# feedback
701701
output$feedback_group <- renderUI({
@@ -801,6 +801,14 @@ rf_parameter_server <- function(input, output, session,
801801
# pprint(out$run_mode)
802802
# })
803803

804+
# # debugging
805+
# observe({
806+
# pprint("--------------------------")
807+
# pprint("RF param")
808+
# pprint(reactiveValuesToList(out))
809+
# pprint("--------------------------")
810+
# })
811+
804812
## output
805813
return(out)
806814
}

0 commit comments

Comments
 (0)