Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pipeline/01-train.R
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,12 @@ if (cv_enable) {
# CV iteration
lgbm_search %>%
lightsnip::axe_tune_data() %>%
# Drop the trace column tune attaches to each nested .notes tibble: it
# holds rlang stack objects that arrow cannot serialize
mutate(.notes = purrr::map(
.notes,
~ dplyr::select(.x, -dplyr::any_of("trace"))
)) %>%
arrow::write_parquet(paths$output$parameter_raw$local)

# Save the parameter ranges searched while tuning
Expand Down
19 changes: 16 additions & 3 deletions pipeline/06-upload.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,23 @@ if (upload_enable) {
read_parquet(paths$output$parameter_raw$local) %>%
tidyr::unnest(cols = .metrics) %>%
mutate(run_id = !!run_id) %>%
# Each model fit can leave a warning in .notes, but notes don't
# record which config produced them. At .iter = 0 each fold holds
# all initial configs, so joining the notes unnested would attach
# every warning to every metrics row for that fold. Collapse notes
# to one row per fold and iteration first so the join can't
# multiply rows
left_join(
rename(., notes = .notes) %>%
tidyr::unnest(cols = notes) %>%
rename(notes = note)
select(., id, .iter, .notes) %>%
tidyr::unnest(cols = .notes) %>%
group_by(id, .iter) %>%
summarize(
location = paste(unique(location), collapse = "; "),
type = paste(unique(type), collapse = "; "),
notes = paste(unique(note), collapse = "; "),
.groups = "drop"
),
by = c("id", ".iter")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Same fix we implement in the condos PR

) %>%
select(-.notes) %>%
rename_with(~ gsub("^\\.", "", .x)) %>%
Expand Down