R/make_nested_model.R

Defines functions make_nested_model

# nocov start
make_nested_model <- function() {
  current <- parsnip::get_model_env()
  if (!"nested_model" %in% current$models) {
    parsnip::set_new_model("nested_model")
  }

  parsnip::set_model_mode(model = "nested_model", mode = "classification")
  parsnip::set_model_mode(model = "nested_model", mode = "regression")
  parsnip::set_model_engine(
    model = "nested_model",
    mode = "classification",
    eng = "nestedmodels"
  )
  parsnip::set_model_engine(
    model = "nested_model",
    mode = "regression",
    eng = "nestedmodels"
  )
  parsnip::set_dependency(
    "nested_model",
    eng = "nestedmodels",
    pkg = "nestedmodels"
  )
}
# nocov end

Try the nestedmodels package in your browser

Any scripts or data that you put into this service are public.

nestedmodels documentation built on Sept. 30, 2023, 5:06 p.m.