fit_xy.kerasnip_spec: fit_xy Method for kerasnip Spec Objects

View source: R/kerasnip_spec_methods.R

fit_xy.kerasnip_specR Documentation

fit_xy Method for kerasnip Spec Objects

Description

S3 method for fit_xy() dispatched on kerasnip_spec objects. Workflows route through fit_xy rather than fit, so this method ensures the kerasnip_model_fit class is attached in the workflow fitting path as well.

kerasnip_spec is stripped from the class before NextMethod() to prevent parsnip's internal specific_model() helper from returning more than one model-class entry, which would break registry lookups. The custom metadata attributes remain on the object and are thus stored inside the resulting model_fit$spec.

Usage

## S3 method for class 'kerasnip_spec'
fit_xy(object, ...)

Arguments

object

A kerasnip_spec model specification.

...

Passed to parsnip::fit_xy.model_spec().

Value

A model_fit object with the additional kerasnip_model_fit class prepended to its class vector.


kerasnip documentation built on Sept. 4, 2026, 1:06 a.m.