error checking model from parsnip object: operator is invalid

Open
#301 7 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
r

Research direction

Start by running the supplied tidymodels and glmnet example, then trace how performance::check_model handles the object returned by pull_workflow_fit(). Identify where the atomic-vector error occurs and add regression coverage for this reproducible classification case; done means check_model no longer raises that error for the example.

Written by the indexing model from the issue text.

Description

3 investigators :grey_question::question: Bug :bug:

Tried to check_model using a very simple glmnet classification task.

Code from here:
https://stackoverflow.com/questions/65969913/extract-plain-model-from-tidymodel-object

library(magrittr)
library(tidymodels)
library(performance)

data(two_class_dat)

glm_spec <- logistic_reg() %>%
  set_engine("glmnet")

norm_rec <- recipe(Class ~ A + B, data = two_class_dat) %>%
  step_normalize(all_predictors())

glm_fit <- workflow() %>%
  add_recipe(norm_rec) %>%
  add_model(glm_spec) %>%
  fit(two_class_dat) %>%
  pull_workflow_fit()



performance::check_model(glm_fit)

Error: $ operator is invalid for atomic vectors

Dominant language
R
Stars
1.2k
Forks
113
Avg merge
9h 8m
Merged PRs (30d)
27

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from easystats/performance

All issues in easystats/performance

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.