Skip to content

There should be a check to make sure an fit method is registered #634

@EmilHvitfeldt

Description

@EmilHvitfeldt

Our change to move all model definitions into parsnip, have resulting in the following uninformative error when you try to use a model that is only has fit methods defined in extension packages.

library(parsnip)

cubist_rules() %>%
  fit(mpg ~., data = mtcars)
#> Error: formula_ is unknown.

pls() %>%
  set_mode("regression") %>%
  fit(mpg ~., data = mtcars)
#> Error: formula_ is unknown.

library(rules)
#> Loading required package: modeldata

cubist_rules() %>%
  fit(mpg ~., data = mtcars)
#> parsnip model object
#> 
#> 
#> Call:
#> cubist.default(x = x, y = y, committees = 1)
#> 
#> Number of samples: 32 
#> Number of predictors: 10 
#> 
#> Number of committees: 1 
#> Number of rules: 1

Created on 2022-01-13 by the reprex package (v2.0.1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviornext release 🚀

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions