Skip to content

Commit

Permalink
Add feature name to model fit warnings (#31)
Browse files Browse the repository at this point in the history
Concatenate the name of the feature to the warning and add a line in the log file.
  • Loading branch information
tkuntz-hsph authored May 11, 2023
1 parent 2a27a74 commit 4bdd87d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion R/fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,14 @@ fit.data <-
formula,
data = dat_sub,
na.action = na.exclude)
}, error = function(err) {
}, warning = function(w) {
message(paste("Feature", colnames(features)[x], ":", w))
logging::logwarn(paste(
"Fitting problem for feature",
x,
"a warning was issued"))
return(fit1)
}, error = function(err) {
fit1 <-
try({
model_function(
Expand Down

0 comments on commit 4bdd87d

Please sign in to comment.