fit.kerasnip_spec: Fit Method for kerasnip Spec Objects

View source: R/kerasnip_spec_methods.R

fit.kerasnip_specR Documentation

Fit Method for kerasnip Spec Objects

Description

S3 method for fit() dispatched on kerasnip_spec objects. Delegates to the standard parsnip fit.model_spec() and then tags the result with the kerasnip_model_fit class so that predict.kerasnip_model_fit() is dispatched on subsequent calls.

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(object, ...)

Arguments

object

A kerasnip_spec model specification.

...

Passed to parsnip::fit.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.