easystats / easystats/performance

error checking model from parsnip object: operator is invalid

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

Nobody has claimed this yet.

3 investigators :grey_question::question: Bug :bug:
Dominant language
R
Stars
1.2k
Forks
109
Avg merge
6h 34m
Merged PRs (30d)
8

Description

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

Contributor guide

Open the contributing guide

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.

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.