Closed cmndrsn closed 10 minutes ago
Solution for Issue (1): Transpose array to avoid recycling issue.
# Initial solution: Transpose before conversion
model_x <- 1:10
model_y <- 11:20
names(model_x) <- names(model_y) <- letters[1:10]
tmp <- rbind(model_x, model_y)
# Example fix
print(as.numeric(t(tmp)))
Solution for Issue (2): Repeat model_id for each observation in array to avoid mismatch between model and summary
## Must repeat model id for as many values in arrays called within rbind (or bind_field)
results <- rbind(model_a = c('valence_mean' = .5, 'arousal_mean' = .8),
model_b = c(.55, .82),
model_c = c(.4, .6))
results_value <- as.numeric(t(results))
results_info <- data.frame(do.call('rbind',
stringr::str_split(colnames(results), '_')))
colnames(results_info) <- c('dim', 'stat')
model_info <- rep(rownames(results), each = ncol(results))
data.frame(model_id = model_info,
results_info,
value = results_value)
Will need to check if this solution presents any additional issues
Looks good.
Problems with
parse_model_output
:(1) Fix name and value mismatch
(2) Ensure
model_attributes
value recycled properly. Needs to repeat attributes (library_id
,model_id
,feature_id
,data_id
,experiment_id
) as many times as there are values in their matching array.