R/tabpfn-constructor.R

Defines functions new_tab_pfn

new_tab_pfn <- function(
  fit,
  levels,
  training,
  logging,
  blueprint,
  call = NULL
) {
  cls <- c(
    "tabpfn.regressor.TabPFNRegressor",
    "tabpfn.classifier.TabPFNClassifier"
  )

  if (!inherits(fit, cls)) {
    cli::cli_abort(
      "The model fit object should have class {.cls {.or {cls}}}, not
			{.cls {class(fit)}}.",
      call = call
    )
  }

  check_character(levels, allow_null = TRUE)

  hardhat::new_model(
    fit = fit,
    levels = levels,
    training = training,
    logging = logging,
    blueprint = blueprint,
    class = "tab_pfn"
  )
}

Try the tabpfn package in your browser

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

tabpfn documentation built on March 18, 2026, 5:07 p.m.