Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a line ending to printed notes #558

Merged
merged 3 commits into from
Oct 4, 2022
Merged

add a line ending to printed notes #558

merged 3 commits into from
Oct 4, 2022

Conversation

topepo
Copy link
Member

@topepo topepo commented Sep 30, 2022

For some notes, show_notes() would not properly break the lines:

library(tidymodels)
set.seed(1)
dat <- sim_classification(150, intercept = 15)
rs <- vfold_cv(dat)
fit_lr <- 
  logistic_reg() %>% 
  fit_resamples(
  class ~ .,
  rs,
  metrics = metric_set(accuracy, kap, recall, precision)
)
#> ! Fold01: preprocessor 1/1, model 1/1: glm.fit: algorithm did not converge
#> ! Fold02: preprocessor 1/1, model 1/1: glm.fit: algorithm did not converge, glm.fit: fitted probabilities numer...
#> ! Fold03: preprocessor 1/1, model 1/1: glm.fit: algorithm did not converge, glm.fit: fitted probabilities numer...
#> ! Fold04: preprocessor 1/1, model 1/1: glm.fit: algorithm did not converge, glm.fit: fitted probabilities numer...
#> ! Fold05: preprocessor 1/1, model 1/1: glm.fit: algorithm did not converge, glm.fit: fitted probabilities numer...
#> ! Fold06: preprocessor 1/1, model 1/1: glm.fit: algorithm did not converge, glm.fit: fitted probabilities numer...
#> ! Fold07: preprocessor 1/1, model 1/1: glm.fit: algorithm did not converge, glm.fit: fitted probabilities numer...
#> ! Fold08: preprocessor 1/1, model 1/1: glm.fit: algorithm did not converge, glm.fit: fitted probabilities numer...
#> ! Fold09: preprocessor 1/1, model 1/1: glm.fit: algorithm did not converge, glm.fit: fitted probabilities numer...
#> ! Fold10: preprocessor 1/1, model 1/1: glm.fit: algorithm did not converge, glm.fit: fitted probabilities numer...
show_notes(fit_lr)
#> unique notes:
#> ───────────────────────────────────
#> glm.fit: algorithm did not converge ───────────────────────────────────
#> glm.fit: algorithm did not converge, glm.fit: fitted probabilities numerically 0 or 1 occurred

Created on 2022-09-30 by the reprex package (v2.0.1)

For this new version:

library(tidymodels)
set.seed(1)
dat <- sim_classification(150, intercept = 15)
rs <- vfold_cv(dat)
fit_lr <- 
  logistic_reg() %>% 
  fit_resamples(
  class ~ .,
  rs,
  metrics = metric_set(accuracy, kap, recall, precision)
)
#> ! Fold01: preprocessor 1/1, model 1/1: glm.fit: algorithm did not converge
#> ! Fold02: preprocessor 1/1, model 1/1: glm.fit: algorithm did not converge, glm.fit: fitted probabilities numer...
#> ! Fold03: preprocessor 1/1, model 1/1: glm.fit: algorithm did not converge, glm.fit: fitted probabilities numer...
#> ! Fold04: preprocessor 1/1, model 1/1: glm.fit: algorithm did not converge, glm.fit: fitted probabilities numer...
#> ! Fold05: preprocessor 1/1, model 1/1: glm.fit: algorithm did not converge, glm.fit: fitted probabilities numer...
#> ! Fold06: preprocessor 1/1, model 1/1: glm.fit: algorithm did not converge, glm.fit: fitted probabilities numer...
#> ! Fold07: preprocessor 1/1, model 1/1: glm.fit: algorithm did not converge, glm.fit: fitted probabilities numer...
#> ! Fold08: preprocessor 1/1, model 1/1: glm.fit: algorithm did not converge, glm.fit: fitted probabilities numer...
#> ! Fold09: preprocessor 1/1, model 1/1: glm.fit: algorithm did not converge, glm.fit: fitted probabilities numer...
#> ! Fold10: preprocessor 1/1, model 1/1: glm.fit: algorithm did not converge, glm.fit: fitted probabilities numer...
show_notes(fit_lr)
#> unique notes:
#> ───────────────────────────────────
#> glm.fit: algorithm did not converge 
#>  ───────────────────────────────────
#> glm.fit: algorithm did not converge, glm.fit: fitted probabilities numerically 0 or 1 occurred

Created on 2022-09-30 by the reprex package (v2.0.1)

@topepo topepo marked this pull request as ready for review September 30, 2022 21:24
@topepo topepo merged commit 3bbdcfe into main Oct 4, 2022
@topepo topepo deleted the better-notes branch October 4, 2022 15:44
@github-actions
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants