Skip to content

handle quasi-likelihood glmnet models better #483

Closed
@topepo

Description

@topepo

These don't return an object class specific to their model:

library(tidymodels)
#> Registered S3 method overwritten by 'tune':
#>   method                   from   
#>   required_pkgs.model_spec parsnip
data("two_class_dat")

logistic_reg(penalty = 0.1) %>% 
  set_engine("glmnet") %>% 
  fit(Class ~ ., data = two_class_dat) %>% 
  pluck("fit") %>% 
  class()
#> [1] "lognet" "glmnet"

logistic_reg(penalty = 0.1) %>% 
  set_engine("glmnet", family = quasibinomial(link = "logit")) %>% 
  fit(Class ~ ., data = two_class_dat) %>% 
  pluck("fit") %>% 
  class()
#> [1] "glmnetfit" "glmnet"

Created on 2021-05-04 by the reprex package (v1.0.0.9000)

We should add class to the parsnip model or restrict this family for this engine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions