Skip to content

Conversation

juliasilge
Copy link
Member

Closes #551

The penalty (cost) for the LiblineaR engine of logistic_reg() does not allow for the submodel "trick".

library(tidymodels)
#> Registered S3 method overwritten by 'tune':
#>   method                   from   
#>   required_pkgs.model_spec parsnip
data(lending_club)
folds <- vfold_cv(lending_club, v = 5)

spec <- logistic_reg(penalty = tune()) %>% 
  set_engine("LiblineaR") %>% 
  set_mode("classification")

tune_grid(
  spec,
  Class ~ int_rate,
  resamples = folds,
  grid = 3
)
#> # Tuning results
#> # 5-fold cross-validation 
#> # A tibble: 5 × 4
#>   splits              id    .metrics         .notes          
#>   <list>              <chr> <list>           <list>          
#> 1 <split [7885/1972]> Fold1 <tibble [6 × 5]> <tibble [0 × 1]>
#> 2 <split [7885/1972]> Fold2 <tibble [6 × 5]> <tibble [0 × 1]>
#> 3 <split [7886/1971]> Fold3 <tibble [6 × 5]> <tibble [0 × 1]>
#> 4 <split [7886/1971]> Fold4 <tibble [6 × 5]> <tibble [0 × 1]>
#> 5 <split [7886/1971]> Fold5 <tibble [6 × 5]> <tibble [0 × 1]>

Created on 2021-09-13 by the reprex package (v2.0.1)

@topepo
Copy link
Member

topepo commented Sep 13, 2021

Looks good!

@juliasilge juliasilge merged commit d9c5ea3 into master Sep 14, 2021
@juliasilge juliasilge deleted the liblinear-submodel-bug branch September 14, 2021 01:59
@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 Sep 29, 2021
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.

Can't tune LiblineaR logistic_reg.
2 participants